Commit f922a1e
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 c7764c3 commit f922a1e
1 file changed
+57
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
| |||
887 | 894 | | |
888 | 895 | | |
889 | 896 | | |
890 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 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 | + | |
891 | 929 | | |
892 | 930 | | |
893 | 931 | | |
| |||
901 | 939 | | |
902 | 940 | | |
903 | 941 | | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
904 | 960 | | |
905 | 961 | | |
906 | 962 | | |
| |||
0 commit comments