From aagero@aage.priv.no  Sun May 25 07:00:30 1997
Received: from aage.priv.no (birk04.studby.uio.no [129.240.214.13])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA23035
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 25 May 1997 07:00:29 -0700 (PDT)
Received: (from aagero@localhost) by aage.priv.no (8.8.5/sendmail95) id QAA00470; Sun, 25 May 1997 16:00:26 +0200 (CEST)
Message-Id: <199705251400.QAA00470@aage.priv.no>
Date: Sun, 25 May 1997 16:00:26 +0200 (CEST)
From: ge Rbekk <aagero@aage.priv.no>
Reply-To: aagero@aage.priv.no
To: FreeBSD-gnats-submit@freebsd.org
Subject: bug in IPDIVERT code in -current
X-Send-Pr-Version: 3.2

>Number:         3678
>Category:       kern
>Synopsis:       bug in IPDIVERT code in -current
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 25 07:10:01 PDT 1997
>Closed-Date:    Wed Apr 29 06:17:59 PDT 1998
>Last-Modified:  Wed Apr 29 06:18:11 PDT 1998
>Originator:     ge Rbekk
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

FreeBSD birk04.studby.uio.no 3.0-CURRENT FreeBSD 3.0-CURRENT #8: Sun May 25 15:43:56 CEST 1997     aagero@birk04.studby.uio.no:/usr/src/sys/compile/AAGE  i386

built from the very latest sources, with peter wemm's latest changes in the
divert code.

>Description:

	when binding to an divert socket, div_bind() in ip_divert.c calls
	in_pcbbind() with an unset inpcb struct pointer, resulting in a
	panic.

>How-To-Repeat:

	pseudo-code:

 	int divsock;
	divsock = socket(..., IPPROT_DIVERT);
	bind(divsock, ...);
 	<panic>

>Fix:
	
--- ip_divert.c.old     Sat May 24 19:23:11 1997
+++ ip_divert.c Sun May 25 15:53:43 1997
@@ -311,6 +311,7 @@
        int s;
        int error;
 
+       inp = sotoinpcb(so);
        s = splnet();
        error = in_pcbbind(inp, nam, p);
        splx(s);
	

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Wed Apr 29 06:17:59 PDT 1998 
State-Changed-Why:  
fixed 
>Unformatted:
