From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 14 10:36:44 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DFDF106564A; Sat, 14 Apr 2012 10:36:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC7C28FC15; Sat, 14 Apr 2012 10:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3EAahWQ024745; Sat, 14 Apr 2012 10:36:43 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3EAah2x024743; Sat, 14 Apr 2012 10:36:43 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201204141036.q3EAah2x024743@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 14 Apr 2012 10:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234279 - stable/9/sys/netinet6 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 10:36:44 -0000 Author: glebius Date: Sat Apr 14 10:36:43 2012 New Revision: 234279 URL: http://svn.freebsd.org/changeset/base/234279 Log: Merge 233272: 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: stable/9/sys/netinet6/in6_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_pcb.c ============================================================================== --- stable/9/sys/netinet6/in6_pcb.c Sat Apr 14 10:20:34 2012 (r234278) +++ stable/9/sys/netinet6/in6_pcb.c Sat Apr 14 10:36:43 2012 (r234279) @@ -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