Module Name:    src
Committed By:   seanb
Date:           Tue Nov 25 19:09:13 UTC 2014

Modified Files:
        src/sys/netinet: in_pcb.c
        src/sys/netinet6: in6_pcb.c

Log Message:
Really make SO_REUSEPORT and SO_REUSEADDR equivalent for multicast
sockets.  From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/netinet/in_pcb.c
cvs rdiff -u -r1.133 -r1.134 src/sys/netinet6/in6_pcb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/in_pcb.c
diff -u src/sys/netinet/in_pcb.c:1.154 src/sys/netinet/in_pcb.c:1.155
--- src/sys/netinet/in_pcb.c:1.154	Tue Nov 25 15:04:37 2014
+++ src/sys/netinet/in_pcb.c	Tue Nov 25 19:09:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_pcb.c,v 1.154 2014/11/25 15:04:37 seanb Exp $	*/
+/*	$NetBSD: in_pcb.c,v 1.155 2014/11/25 19:09:13 seanb Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.154 2014/11/25 15:04:37 seanb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.155 2014/11/25 19:09:13 seanb Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -310,7 +310,7 @@ in_pcbbind_port(struct inpcb *inp, struc
 		 * 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))
 			reuseport = SO_REUSEADDR|SO_REUSEPORT;
 	} 
 

Index: src/sys/netinet6/in6_pcb.c
diff -u src/sys/netinet6/in6_pcb.c:1.133 src/sys/netinet6/in6_pcb.c:1.134
--- src/sys/netinet6/in6_pcb.c:1.133	Tue Nov 25 15:04:37 2014
+++ src/sys/netinet6/in6_pcb.c	Tue Nov 25 19:09:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_pcb.c,v 1.133 2014/11/25 15:04:37 seanb Exp $	*/
+/*	$NetBSD: in6_pcb.c,v 1.134 2014/11/25 19:09:13 seanb Exp $	*/
 /*	$KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.133 2014/11/25 15:04:37 seanb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.134 2014/11/25 19:09:13 seanb Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -307,7 +307,7 @@ in6_pcbbind_port(struct in6pcb *in6p, st
 		 * 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))
 			reuseport = SO_REUSEADDR|SO_REUSEPORT;
 	}
 

Reply via email to