Date: Tue, 6 Sep 2016 00:03:27 -0700 From: Maxim Sobolev <sobomax@freebsd.org> To: "Andrey V. Elsukov" <bu7cher@yandex.ru> Cc: FreeBSD Net <freebsd-net@freebsd.org>, Gleb Smirnoff <glebius@freebsd.org> Subject: Re: Which UDP sockets the incoming packet is delivered to when both wildcard and non-wildcard listeners are present Message-ID: <CAH7qZfujHXzzigZHXUr%2Bk2ra_rs3dk8utOfSWJjWJswduKL0mg@mail.gmail.com> In-Reply-To: <a3015a81-9feb-a8fa-cb47-ba9f3e3ca773@yandex.ru> References: <CAH7qZfvZ63rcNhrwzMzbTkB8S-F%2Bk1FF=0vXvgwd%2BqGPSyA%2BcQ@mail.gmail.com> <a3015a81-9feb-a8fa-cb47-ba9f3e3ca773@yandex.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
Andrey, 1. Sockets are unconnected 2. Datagrams are unicast -Max On Mon, Sep 5, 2016 at 6:46 AM, Andrey V. Elsukov <bu7cher@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 > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAH7qZfujHXzzigZHXUr%2Bk2ra_rs3dk8utOfSWJjWJswduKL0mg>