Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet get_tcppcb() is nearly always called upon entry ...
details: https://anonhg.NetBSD.org/src/rev/0448dfff753a
branches: trunk
changeset: 331191:0448dfff753a
user: rtr <rtr%NetBSD.org@localhost>
date: Tue Aug 05 07:10:41 2014 +0000
description:
get_tcppcb() is nearly always called upon entry to usrreqs so
KASSERT(solocked(so)) inside it and remove the redundant KASSERT
everywhere we are using tcp_getpcb()
diffstat:
sys/netinet/tcp_usrreq.c | 25 +++++--------------------
1 files changed, 5 insertions(+), 20 deletions(-)
diffs (109 lines):
diff -r 2fa91b8087c0 -r 0448dfff753a sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c Tue Aug 05 06:35:55 2014 +0000
+++ b/sys/netinet/tcp_usrreq.c Tue Aug 05 07:10:41 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.196 2014/08/05 05:24:26 rtr Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.197 2014/08/05 07:10:41 rtr 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.196 2014/08/05 05:24:26 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.197 2014/08/05 07:10:41 rtr Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -181,6 +181,9 @@
tcp_getpcb(struct socket *so, struct inpcb **inp,
struct in6pcb **in6p, struct tcpcb **tp)
{
+
+ KASSERT(solocked(so));
+
/*
* When a TCP is attached to a socket, then there will be
* a (struct inpcb) pointed at by the socket, and this
@@ -273,8 +276,6 @@
return (0);
}
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0) {
splx(s);
return error;
@@ -687,8 +688,6 @@
struct tcpcb *tp = NULL;
int s;
- KASSERT(solocked(so));
-
if (tcp_getpcb(so, &inp, &in6p, &tp) != 0)
return;
@@ -707,8 +706,6 @@
int error = 0;
int s;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
@@ -746,8 +743,6 @@
int error = 0;
int ostate = 0;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
@@ -792,8 +787,6 @@
int ostate = 0;
int s;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
@@ -836,8 +829,6 @@
int error = 0;
int ostate = 0;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
@@ -925,8 +916,6 @@
int ostate = 0;
int s;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
@@ -961,8 +950,6 @@
int ostate = 0;
int s;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
@@ -991,8 +978,6 @@
int ostate = 0;
int s;
- KASSERT(solocked(so));
-
if ((error = tcp_getpcb(so, &inp, &in6p, &tp)) != 0)
return error;
Home |
Main Index |
Thread Index |
Old Index