diff options
author | trociny <trociny@FreeBSD.org> | 2013-07-12 19:08:33 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2013-07-12 19:08:33 +0000 |
commit | 69ab640b6b8e74cb3de3e8f1ba43e34b75e644c5 (patch) | |
tree | 291ebd795e0ea8611bf324e9df13682da174d337 /sys/netinet6 | |
parent | d323dc8e3aaeeb4826e855b8ab52985bc8ffa0bf (diff) | |
download | FreeBSD-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/netinet6')
-rw-r--r-- | sys/netinet6/in6_pcb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index a0a6874..fb84279 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -156,7 +156,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, * 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 (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct ifaddr *ifa; |