summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r--sys/netinet/raw_ip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 85eaaf2..dd79877 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -160,18 +160,22 @@ raw_append(struct inpcb *last, struct ip *ip, struct mbuf *n)
#endif
if (!policyfail) {
struct mbuf *opts = NULL;
+ struct socket *so;
+ so = last->inp_socket;
if ((last->inp_flags & INP_CONTROLOPTS) ||
- (last->inp_socket->so_options & SO_TIMESTAMP))
+ (so->so_options & SO_TIMESTAMP))
ip_savecontrol(last, &opts, ip, n);
- if (sbappendaddr(&last->inp_socket->so_rcv,
+ SOCKBUF_LOCK(&so->so_rcv);
+ if (sbappendaddr_locked(&so->so_rcv,
(struct sockaddr *)&ripsrc, n, opts) == 0) {
/* should notify about lost packet */
m_freem(n);
if (opts)
m_freem(opts);
+ SOCKBUF_UNLOCK(&so->so_rcv);
} else
- sorwakeup(last->inp_socket);
+ sorwakeup_locked(so);
} else
m_freem(n);
return policyfail;
OpenPOWER on IntegriCloud