summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2013-07-12 19:08:33 +0000
committertrociny <trociny@FreeBSD.org>2013-07-12 19:08:33 +0000
commit69ab640b6b8e74cb3de3e8f1ba43e34b75e644c5 (patch)
tree291ebd795e0ea8611bf324e9df13682da174d337 /sys/netinet/in_pcb.c
parentd323dc8e3aaeeb4826e855b8ab52985bc8ffa0bf (diff)
downloadFreeBSD-src-69ab640b6b8e74cb3de3e8f1ba43e34b75e644c5.zip
FreeBSD-src-69ab640b6b8e74cb3de3e8f1ba43e34b75e644c5.tar.gz
A complete duplication of binding should be allowed if on both new and
duplicated sockets a multicast address is bound and either SO_REUSEPORT or SO_REUSEADDR is set. But actually it works for the following combinations: * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new; * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new; * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new; and fails for this: * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new. Fix the last case. PR: 179901 MFC after: 1 month
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 3506b74..eb15a38 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -554,7 +554,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
* and a multicast address is bound on both
* new and duplicated sockets.
*/
- if (so->so_options & SO_REUSEADDR)
+ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0)
reuseport = SO_REUSEADDR|SO_REUSEPORT;
} else if (sin->sin_addr.s_addr != INADDR_ANY) {
sin->sin_port = 0; /* yech... */
OpenPOWER on IntegriCloud