Which UDP sockets the incoming packet is delivered to when both wildcard and non-wildcard listeners are present
Maxim Sobolev
sobomax at freebsd.org
Tue Sep 6 07:03:30 UTC 2016
Andrey,
1. Sockets are unconnected
2. Datagrams are unicast
-Max
On Mon, Sep 5, 2016 at 6:46 AM, Andrey V. Elsukov <bu7cher at yandex.ru> wrote:
> On 05.09.16 15:42, Maxim Sobolev wrote:
> > Suppose we have two threads in the system both bound to a same specific
> UDP
> > port, one using INADDR_ANY and another one using actual IP. When incoming
> > message arrives to that port is there any guarantee as to which of those
> > two threads going to see the message? The question has arisen from the
> > observation that most of the time the thread that is bound to a specific
> IP
> > gets them, but occasionally we see INADDR_ANY-bound thread receiving few
> > packets as well. So that behavior seems to be "almost deterministic" and
> we
> > are wondering where that "almost" part is expected or some kind of socket
> > matching bug?
>
> Are your sockets connected? I.e. did you use connect+send? And do you
> receive unicast datagrams or some broadcast/multicast can appear?
>
> --
> WBR, Andrey V. Elsukov
>
>
More information about the freebsd-net
mailing list