diff options
Diffstat (limited to 'sys/netinet/in_pcb.c')
| -rw-r--r-- | sys/netinet/in_pcb.c | 41 | 
1 files changed, 30 insertions, 11 deletions
| diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index dbe48242381d..f573e07163fd 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2665,10 +2665,13 @@ in_pcbinshash(struct inpcb *inp)  	    INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_porthashmask)];  	/* -	 * Add entry to load balance group. -	 * Only do this if SO_REUSEPORT_LB is set. +	 * Ignore SO_REUSEPORT_LB if the socket is connected.  Really this case +	 * should be an error, but for UDP sockets it is not, and some +	 * applications erroneously set it on connected UDP sockets, so we can't +	 * change this without breaking compatibility.  	 */ -	if ((inp->inp_socket->so_options & SO_REUSEPORT_LB) != 0) { +	if (!connected && +	    (inp->inp_socket->so_options & SO_REUSEPORT_LB) != 0) {  		int error = in_pcbinslbgrouphash(inp, M_NODOM);  		if (error != 0)  			return (error); @@ -2770,6 +2773,10 @@ in_pcbrehash(struct inpcb *inp)  		connected = !in_nullhost(inp->inp_faddr);  	} +	/* See the comment in in_pcbinshash(). */ +	if (connected && (inp->inp_flags & INP_INLBGROUP) != 0) +		in_pcbremlbgrouphash(inp); +  	/*  	 * When rehashing, the caller must ensure that either the new or the old  	 * foreign address was unspecified. @@ -3051,7 +3058,7 @@ db_print_inconninfo(struct in_conninfo *inc, const char *name, int indent)  	    ntohs(inc->inc_fport));  } -static void +void  db_print_inpflags(int inp_flags)  {  	int comma; @@ -3069,10 +3076,6 @@ db_print_inpflags(int inp_flags)  		db_printf("%sINP_RECVDSTADDR", comma ? ", " : "");  		comma = 1;  	} -	if (inp_flags & INP_ORIGDSTADDR) { -		db_printf("%sINP_ORIGDSTADDR", comma ? ", " : ""); -		comma = 1; -	}  	if (inp_flags & INP_HDRINCL) {  		db_printf("%sINP_HDRINCL", comma ? ", " : "");  		comma = 1; @@ -3105,6 +3108,14 @@ db_print_inpflags(int inp_flags)  		db_printf("%sINP_DONTFRAG", comma ? ", " : "");  		comma = 1;  	} +	if (inp_flags & INP_BINDANY) { +		db_printf("%sINP_BINDANY", comma ? ", " : ""); +		comma = 1; +	} +	if (inp_flags & INP_INHASHLIST) { +		db_printf("%sINP_INHASHLIST", comma ? ", " : ""); +		comma = 1; +	}  	if (inp_flags & INP_RECVTOS) {  		db_printf("%sINP_RECVTOS", comma ? ", " : "");  		comma = 1; @@ -3147,15 +3158,23 @@ db_print_inpflags(int inp_flags)  	}  	if (inp_flags & INP_ONESBCAST) {  		db_printf("%sINP_ONESBCAST", comma ? ", " : ""); -		comma  = 1; +		comma = 1;  	}  	if (inp_flags & INP_DROPPED) {  		db_printf("%sINP_DROPPED", comma ? ", " : ""); -		comma  = 1; +		comma = 1;  	}  	if (inp_flags & INP_SOCKREF) {  		db_printf("%sINP_SOCKREF", comma ? ", " : ""); -		comma  = 1; +		comma = 1; +	} +	if (inp_flags & INP_RESERVED_0) { +		db_printf("%sINP_RESERVED_0", comma ? ", " : ""); +		comma = 1; +	} +	if (inp_flags & INP_BOUNDFIB) { +		db_printf("%sINP_BOUNDFIB", comma ? ", " : ""); +		comma = 1;  	}  	if (inp_flags & IN6P_RFC2292) {  		db_printf("%sIN6P_RFC2292", comma ? ", " : ""); | 
