summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2002-06-21 22:52:48 +0000
committerhsu <hsu@FreeBSD.org>2002-06-21 22:52:48 +0000
commit80cef86a8d1c8a12a6d014679144adb8fc1a7b1f (patch)
tree75df02a3f5530d21077e18189da1ef40a5851fb1 /sys/netinet
parent070181b5250c831d3cbb266b574f814eff3eec00 (diff)
downloadFreeBSD-src-80cef86a8d1c8a12a6d014679144adb8fc1a7b1f.zip
FreeBSD-src-80cef86a8d1c8a12a6d014679144adb8fc1a7b1f.tar.gz
TCP notify functions can change the pcb list.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_subr.c4
-rw-r--r--sys/netinet/tcp_timewait.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 5b1e834..f7800d2 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1057,7 +1057,7 @@ tcp_ctlinput(cmd, sa, vip)
s = splnet();
th = (struct tcphdr *)((caddr_t)ip
+ (IP_VHL_HL(ip->ip_vhl) << 2));
- INP_INFO_RLOCK(&tcbinfo);
+ INP_INFO_WLOCK(&tcbinfo);
inp = in_pcblookup_hash(&tcbinfo, faddr, th->th_dport,
ip->ip_src, th->th_sport, 0, NULL);
if (inp != NULL) {
@@ -1083,7 +1083,7 @@ tcp_ctlinput(cmd, sa, vip)
#endif
syncache_unreach(&inc, th);
}
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_WUNLOCK(&tcbinfo);
splx(s);
} else
in_pcbnotifyall(&tcbinfo, faddr, inetctlerrmap[cmd], notify);
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 5b1e834..f7800d2 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -1057,7 +1057,7 @@ tcp_ctlinput(cmd, sa, vip)
s = splnet();
th = (struct tcphdr *)((caddr_t)ip
+ (IP_VHL_HL(ip->ip_vhl) << 2));
- INP_INFO_RLOCK(&tcbinfo);
+ INP_INFO_WLOCK(&tcbinfo);
inp = in_pcblookup_hash(&tcbinfo, faddr, th->th_dport,
ip->ip_src, th->th_sport, 0, NULL);
if (inp != NULL) {
@@ -1083,7 +1083,7 @@ tcp_ctlinput(cmd, sa, vip)
#endif
syncache_unreach(&inc, th);
}
- INP_INFO_RUNLOCK(&tcbinfo);
+ INP_INFO_WUNLOCK(&tcbinfo);
splx(s);
} else
in_pcbnotifyall(&tcbinfo, faddr, inetctlerrmap[cmd], notify);
OpenPOWER on IntegriCloud