You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and did a tcpdump in parallel looking for packages containing my local ipv4 that should be used for connecting:
sudo tcpdump -n ip host 192.168.0.99
[sudo] password for bongo:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
What did you expect to see?
There should be packages showing up in tcpdump
the "actual ip used" line should show a IPv4 address and not IPv6
What did you see instead?
"actual ip used" line shows my public v6 address as used for connection
there are no packages showing up using the forced LocalAddr as source
What do you wish?
I wish that
forcing of LocalAddr is effective
it's possible to assign multiple LocalAddrs (one for v4 one for v6) since I want to use a forced address other than the default one also if a host is available on v6 (dual stack/fallback)
the design of http.Transport and on a lower level net.Dialer is not in a way that forcing v4 or v6 only connectivity is possible (at least I tried hard to find a way that's exposed and did not manage to), this should be made possible
What do you suspect to be the reason for this behaviour?
I believe that somewhere in the source of the net/http library a hardcoded "tcp" automatically chooses IPv6 for connecting though it definitely shouldn't...
The text was updated successfully, but these errors were encountered:
I discovered this may be related to the used http client since when constructing from a http.Client v4 is used.
Closing this issue for now, until I verified that there is still something not working for which the library is not responsible.
mikioh
changed the title
Setting LocalAddr to v4 address in net.Dialer not effective if v6 available
net: Setting LocalAddr to v4 address in net.Dialer not effective if v6 available
Mar 15, 2016
go version
)?go version go1.5.3 linux/amd64
go env
)?I ran the following code: http://play.golang.org/p/sujhjFG8W2
and did a tcpdump in parallel looking for packages containing my local ipv4 that should be used for connecting:
I wish that
I believe that somewhere in the source of the net/http library a hardcoded "tcp" automatically chooses IPv6 for connecting though it definitely shouldn't...
The text was updated successfully, but these errors were encountered: