Commit cdf34b0
committed
pkg/hostagent: Support port forwarding to direct guest IP
Change to use `github.com/inetaf/tcpproxy`:
- pkg/driver/vz/vsock_forwarder.go
- pkg/portfwd/client.go
- pkg/portfwdserver/server.go
pkg/portfwd:
- Use `dialContext` instead of `client` to use `net.Conn` other than `GrpcClientRW`.
- Change to create proxies from `dialContext` parameters instead of `conn`.
- Add `DialContextToGRPCTunnel()` to return `DialContext` function that connects to GRPC tunnel.
pkg/hostagent:
- Add `HostAgent.DialContextToGuestIP()` to return `DialContext` function that connects to the guest IP directly.
If the guest IP is not known, it returns nil.
- Prefer `HostAgent.DialContextToGuestIP()` over `portfwd.DialContextToGRPCTunnel()`.
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
pkg/hostagent: Use `HostAgent.DialContextToGuestIP()` if the IP is accessible directly.
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
Revert to "github.com/containers/gvisor-tap-vsock/pkg/tcpproxy"
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
# Conflicts:
# pkg/hostagent/hostagent.go
pkg/hostagent: Aware forwarding guest address is IPv4 or IPv6
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
pkg/hostagent: Fallback to GRPC forwarder if dialing to a direct ip fails
Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
# Conflicts:
# pkg/hostagent/hostagent.go1 parent 3681784 commit cdf34b0
1 file changed
+57
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
534 | 541 | | |
535 | 542 | | |
536 | 543 | | |
| |||
891 | 898 | | |
892 | 899 | | |
893 | 900 | | |
894 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
895 | 933 | | |
896 | 934 | | |
897 | 935 | | |
| |||
905 | 943 | | |
906 | 944 | | |
907 | 945 | | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
908 | 964 | | |
909 | 965 | | |
910 | 966 | | |
| |||
0 commit comments