summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/icmp6.c
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-05-20 05:41:09 +0000
committertanimura <tanimura@FreeBSD.org>2002-05-20 05:41:09 +0000
commit92d8381dd544a8237b3fd68c4e7fce9bd0903fb2 (patch)
tree2465ddbcecac65f96c5c6d5cef1a4fe3f1ac03f8 /sys/netinet6/icmp6.c
parent969293170b27461145f69a538d5abd15fea34ba1 (diff)
downloadFreeBSD-src-92d8381dd544a8237b3fd68c4e7fce9bd0903fb2.zip
FreeBSD-src-92d8381dd544a8237b3fd68c4e7fce9bd0903fb2.tar.gz
Lock down a socket, milestone 1.
o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r--sys/netinet6/icmp6.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 38332b2..f9994c6 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1941,8 +1941,11 @@ icmp6_rip6_input(mp, off)
if (opts) {
m_freem(opts);
}
- } else
+ } else {
+ SOCK_LOCK(last->in6p_socket);
sorwakeup(last->in6p_socket);
+ SOCK_UNLOCK(last->in6p_socket);
+ }
opts = NULL;
}
}
@@ -1958,8 +1961,11 @@ icmp6_rip6_input(mp, off)
m_freem(m);
if (opts)
m_freem(opts);
- } else
+ } else {
+ SOCK_LOCK(last->in6p_socket);
sorwakeup(last->in6p_socket);
+ SOCK_UNLOCK(last->in6p_socket);
+ }
} else {
m_freem(m);
ip6stat.ip6s_delivered--;
OpenPOWER on IntegriCloud