summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-07-19 12:24:27 +0000
committerrwatson <rwatson@FreeBSD.org>2005-07-19 12:24:27 +0000
commitd49765d3fd851d4b1a585c996379bc57a6dff02c (patch)
tree56a57d434ecb6747ed3c7b91930d5ac5ce1f88c1 /sys/netinet/in_pcb.c
parenta7ad7c72d9253091f4c4b21ecd753969eddab4d8 (diff)
downloadFreeBSD-src-d49765d3fd851d4b1a585c996379bc57a6dff02c.zip
FreeBSD-src-d49765d3fd851d4b1a585c996379bc57a6dff02c.tar.gz
Remove no-op spl references in in_pcb.c, since in_pcb locking has been
basically complete for several years now. Update one spl comment to reference the locking strategy. MFC after: 3 days
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index ed511fe..55e9f9d 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -160,9 +160,9 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, CTLFLAG_RW,
/*
* in_pcb.c: manage the Protocol Control Blocks.
*
- * NOTE: It is assumed that most of these functions will be called at
- * splnet(). XXX - There are, unfortunately, a few exceptions to this
- * rule that should be fixed.
+ * NOTE: It is assumed that most of these functions will be called with
+ * the pcbinfo lock held, and often, the inpcb lock held, as these utility
+ * functions often modify hash chains or addresses in pcbs.
*/
/*
@@ -769,17 +769,14 @@ in_setsockaddr(so, nam, pcbinfo)
struct sockaddr **nam;
struct inpcbinfo *pcbinfo;
{
- int s;
register struct inpcb *inp;
struct in_addr addr;
in_port_t port;
- s = splnet();
INP_INFO_RLOCK(pcbinfo);
inp = sotoinpcb(so);
if (!inp) {
INP_INFO_RUNLOCK(pcbinfo);
- splx(s);
return ECONNRESET;
}
INP_LOCK(inp);
@@ -787,7 +784,6 @@ in_setsockaddr(so, nam, pcbinfo)
addr = inp->inp_laddr;
INP_UNLOCK(inp);
INP_INFO_RUNLOCK(pcbinfo);
- splx(s);
*nam = in_sockaddr(port, &addr);
return 0;
@@ -802,17 +798,14 @@ in_setpeeraddr(so, nam, pcbinfo)
struct sockaddr **nam;
struct inpcbinfo *pcbinfo;
{
- int s;
register struct inpcb *inp;
struct in_addr addr;
in_port_t port;
- s = splnet();
INP_INFO_RLOCK(pcbinfo);
inp = sotoinpcb(so);
if (!inp) {
INP_INFO_RUNLOCK(pcbinfo);
- splx(s);
return ECONNRESET;
}
INP_LOCK(inp);
@@ -820,7 +813,6 @@ in_setpeeraddr(so, nam, pcbinfo)
addr = inp->inp_faddr;
INP_UNLOCK(inp);
INP_INFO_RUNLOCK(pcbinfo);
- splx(s);
*nam = in_sockaddr(port, &addr);
return 0;
@@ -835,9 +827,7 @@ in_pcbnotifyall(pcbinfo, faddr, errno, notify)
{
struct inpcb *inp, *ninp;
struct inpcbhead *head;
- int s;
- s = splnet();
INP_INFO_WLOCK(pcbinfo);
head = pcbinfo->listhead;
for (inp = LIST_FIRST(head); inp != NULL; inp = ninp) {
@@ -858,7 +848,6 @@ in_pcbnotifyall(pcbinfo, faddr, errno, notify)
INP_UNLOCK(inp);
}
INP_INFO_WUNLOCK(pcbinfo);
- splx(s);
}
void
@@ -870,7 +859,6 @@ in_pcbpurgeif0(pcbinfo, ifp)
struct ip_moptions *imo;
int i, gap;
- /* why no splnet here? XXX */
INP_INFO_RLOCK(pcbinfo);
LIST_FOREACH(inp, pcbinfo->listhead, inp_list) {
INP_LOCK(inp);
OpenPOWER on IntegriCloud