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
A connected UDP socket only receives packets from the connected address. All other packets are discarded. (See e.g. man 2 connect, "If the socket sockfd is of type SOCK_DGRAM, then addr [...] is the only address from which datagrams are received", analogous in BSD man connect).
In snet, this is not enforced. A Dialed snet connection will receive packets from any source address. If the caller uses Read (and not ReadFrom), it will have no way to tell whether the packet is from the connected host, or some other source.
Related note: the comment on snet.scionConnReader.Read() says: "If the remote address for the connection is unknown, Read returns an error." This is not implemented (it was, git blame shows removed in #2411).
It appears that these issues are related; Read should check that the source of the packet is the connected remote address. Stray packets should be silently dropped. If there is no connected remote address, Read should error.
The text was updated successfully, but these errors were encountered:
Follow up from #4344.
A connected UDP socket only receives packets from the connected address. All other packets are discarded. (See e.g. man 2 connect, "If the socket sockfd is of type SOCK_DGRAM, then addr [...] is the only address from which datagrams are received", analogous in BSD man connect).
In
snet
, this is not enforced. ADial
ed snet connection will receive packets from any source address. If the caller usesRead
(and notReadFrom
), it will have no way to tell whether the packet is from the connected host, or some other source.Related note: the comment on
snet.scionConnReader.Read()
says: "If the remote address for the connection is unknown, Read returns an error." This is not implemented (it was, git blame shows removed in #2411).It appears that these issues are related;
Read
should check that the source of the packet is the connected remote address. Stray packets should be silently dropped. If there is no connected remote address,Read
should error.The text was updated successfully, but these errors were encountered: