Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Mar 2012 08:43:38 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233272 - head/sys/netinet6
Message-ID:  <201203210843.q2L8hcm6062475@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Mar 21 08:43:38 2012
New Revision: 233272
URL: http://svn.freebsd.org/changeset/base/233272

Log:
  in6_pcblookup_local() still can return a pcb with NULL
  inp_socket. To avoid panic, do not dereference inp_socket,
  but obtain reuse port option from inp_flags2, like this
  is done after next call to in_pcblookup_local() a few lines
  down below.
  
  Submitted by:	rwatson

Modified:
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet6/in6_pcb.c
==============================================================================
--- head/sys/netinet6/in6_pcb.c	Wed Mar 21 08:38:42 2012	(r233271)
+++ head/sys/netinet6/in6_pcb.c	Wed Mar 21 08:43:38 2012	(r233272)
@@ -245,8 +245,8 @@ in6_pcbbind(register struct inpcb *inp, 
 				if (tw == NULL ||
 				    (reuseport & tw->tw_so_options) == 0)
 					return (EADDRINUSE);
-			} else if (t && (reuseport & t->inp_socket->so_options)
-			    == 0) {
+			} else if (t && (reuseport == 0 ||
+			    (t->inp_flags2 & INP_REUSEPORT) == 0)) {
 				return (EADDRINUSE);
 			}
 #ifdef INET



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203210843.q2L8hcm6062475>