Module Name:    src
Committed By:   rmind
Date:           Wed May 21 18:41:43 UTC 2014

Modified Files:
        src/sys/netinet: tcp_usrreq.c

Log Message:
tcp_usrreq: fix the previous correctly - restore the assert logic,
but move it after the PRU_SENSE check.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/netinet/tcp_usrreq.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/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.175 src/sys/netinet/tcp_usrreq.c:1.176
--- src/sys/netinet/tcp_usrreq.c:1.175	Wed May 21 13:21:20 2014
+++ src/sys/netinet/tcp_usrreq.c	Wed May 21 18:41:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.175 2014/05/21 13:21:20 pgoyette Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.176 2014/05/21 18:41:43 rmind Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.175 2014/05/21 13:21:20 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.176 2014/05/21 18:41:43 rmind Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -249,10 +249,6 @@ tcp_usrreq(struct socket *so, int req, s
 		splx(s);
 		return EAFNOSUPPORT;
 	}
-
-#ifdef INET6
-	KASSERT((inp == NULL) || (in6p == NULL));
-#endif
 	KASSERT(!control || (req == PRU_SEND || req == PRU_SENDOOB));
 
 	/*
@@ -269,6 +265,9 @@ tcp_usrreq(struct socket *so, int req, s
 		error = EINVAL;
 		goto release;
 	}
+#ifdef INET6
+	KASSERT((inp != NULL) ^ (in6p != NULL));
+#endif
 #ifdef INET
 	if (inp) {
 		tp = intotcpcb(inp);

Reply via email to