Open matheus23 opened 2 months ago
I suspect this can cause issues when there's multiple IP interfaces connected to the device and the OS ends up choosing the wrong one.
The problem also arises when you have multiple addresses on the same subnet on the same interface. IIRC this is the default on Windows, and a supported configuration on Linux, due to RFC 4941 privacy extensions: a host may have both a stable EUI-64 address, a primary temporary address, and one or more old temporary addresses being turned down, all on the same WAN subnet. An IPv6-based protocol is unlikely to be able to establish a connection correctly in this environment without correctly specifying source addresses.
As a general rule of thumb, you should send from whatever address you received on, for a given path.
(I previously wrote this on discord somewhere, repeating here)
We need to store the dst_ip
of the RecvMeta
in the PathState
and when we return the "addr_for_send" it should be returned with it so that the send path can put it in src_ip
.
I'm not sure if this should be blocking for the transition to 0.11, what do you think @matheus23 ?
I do think we should do the same on all platforms regardless.
We need to store the
dst_ip
of theRecvMeta
in thePathState
and when we return the "addr_for_send" it should be returned with it so that the send path can put it insrc_ip
.
Yeah agreed, we should do this & do it like this.
I'm not sure if this should be blocking for the transition to 0.11, what do you think @matheus23 ?
I don't think this should be blocking the transition.
transmit.src_ip
information, in quinn 0.11 it does. The current state in the dig/quinn11
branch simply restores the quinn 0.10 behavior.dig/quinn11
branch. Let's get that merged with the fewest bugs possible & the least changes. Then we can start "using newer features" of quinn 11, such as being able to supply src_ip
in transmits on windows (and in general use the correct ones).
Currently, the
src_ip
values forquinn::Transmit
s are indirectly set by us via our rewriting ofdst_ip
(and choice ofdst_ip
in the relay case) in theRecvMeta
ofpoll_recv
(inMagicSock
).This can cause issues, e.g. when unspecified IP addrs (
0.0.0.0
or::
) make it tosrc_ip
. Windows seems more pedantic about this and errors out.We return unspecified IP addrs, because we set
dst_ip
toMagicSock::normalized_local_addr
.As an interim solution, we've set it to
None
on windows. I suspect this can cause issues when there's multiple IP interfaces connected to the device and the OS ends up choosing the wrong one.Instead, we should probably figure out the interface we want to send from via netcheck.
More information in this PR comment.