Date: Mon, 5 Sep 2016 16:46:17 +0300 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Maxim Sobolev <sobomax@freebsd.org>, 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: <a3015a81-9feb-a8fa-cb47-ba9f3e3ca773@yandex.ru> In-Reply-To: <CAH7qZfvZ63rcNhrwzMzbTkB8S-F%2Bk1FF=0vXvgwd%2BqGPSyA%2BcQ@mail.gmail.com> References: <CAH7qZfvZ63rcNhrwzMzbTkB8S-F%2Bk1FF=0vXvgwd%2BqGPSyA%2BcQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5VbiFm0ebbL8ttbXHxreUOtTE0A4A0FRI Content-Type: multipart/mixed; boundary="vxhEb7ONWc6MIuvqeOsEVuQstACl9ujL9" From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: Maxim Sobolev <sobomax@freebsd.org>, FreeBSD Net <freebsd-net@freebsd.org>, Gleb Smirnoff <glebius@freebsd.org> Message-ID: <a3015a81-9feb-a8fa-cb47-ba9f3e3ca773@yandex.ru> Subject: Re: Which UDP sockets the incoming packet is delivered to when both wildcard and non-wildcard listeners are present References: <CAH7qZfvZ63rcNhrwzMzbTkB8S-F+k1FF=0vXvgwd+qGPSyA+cQ@mail.gmail.com> In-Reply-To: <CAH7qZfvZ63rcNhrwzMzbTkB8S-F+k1FF=0vXvgwd+qGPSyA+cQ@mail.gmail.com> --vxhEb7ONWc6MIuvqeOsEVuQstACl9ujL9 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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 incomi= ng > message arrives to that port is there any guarantee as to which of thos= e > 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 specifi= c IP > gets them, but occasionally we see INADDR_ANY-bound thread receiving fe= w > packets as well. So that behavior seems to be "almost deterministic" an= d we > are wondering where that "almost" part is expected or some kind of sock= et > 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? --=20 WBR, Andrey V. Elsukov --vxhEb7ONWc6MIuvqeOsEVuQstACl9ujL9-- --5VbiFm0ebbL8ttbXHxreUOtTE0A4A0FRI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEvBAEBCAAZBQJXzXctEhxidTdjaGVyQHlhbmRleC5ydQAKCRABxeoEEMihetDJ B/wNrwZlItx9l6jG6CbCsrSXor4TjNgf+WCAAb8tBSHvL38mWEUKuQCJ3pHBMbRT PEe+iNa3rrBc0DO/Q4DfLG333iBmMeNbwXZUMPQ6Bx4BWJh929c7uAPdWcRxR4IP 1dgpqck6YJ+N2z/yQLatNb3it2kOgKkjX9qrncSeCBakeWTm7wdOP5ViVBPPG0XG emVxd6oED3parfyPm8QMqdJ+RSW0TojKc7A3HV/wNuYIRmJtjRJyFf4yFiZBufgJ /C762EnYk6PcaLN83h8Ok+QDSUeRd7k1c33TMB75bjAA3iusII3qJla3e1bd/lMj Uzc8vhG8SUkx0asQFaK6hQAt =gq2O -----END PGP SIGNATURE----- --5VbiFm0ebbL8ttbXHxreUOtTE0A4A0FRI--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a3015a81-9feb-a8fa-cb47-ba9f3e3ca773>