From 1d78192b35f25532650e095d1ab84b31d3dd6683 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Sat, 8 Nov 2003 22:51:18 +0000 Subject: [PATCH] the sbappendaddr call in socket_send must be protected by Giant because it can happen from an MPSAFE callout Supported by: FreeBSD Foundation --- sys/netinet/ip_mroute.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index a7265ac1b3f7..447cc27c5b27 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1289,10 +1289,13 @@ static int socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src) { if (s) { + mtx_lock(&Giant); /* XXX until sockets are locked */ if (sbappendaddr(&s->so_rcv, (struct sockaddr *)src, mm, NULL) != 0) { sorwakeup(s); + mtx_unlock(&Giant); return 0; } + mtx_unlock(&Giant); } m_freem(mm); return -1;