From 6c58cbc307f2a3f9ed1df1335c8eebe774c1a109 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Fri, 21 May 1999 23:15:23 +0000 Subject: For hard expiration-pressure you need to protect PF_KEY socket queueing with spltdb() --- sys/net/pfkey.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/net/pfkey.c b/sys/net/pfkey.c index 42be9bd022b..46a0a4f33fa 100644 --- a/sys/net/pfkey.c +++ b/sys/net/pfkey.c @@ -97,6 +97,7 @@ int pfkey_sendup(struct socket *socket, struct mbuf *packet, int more) { struct mbuf *packet2; + int s; if (more) { if (!(packet2 = m_copym(packet, 0, M_COPYALL, M_DONTWAIT))) @@ -104,10 +105,13 @@ pfkey_sendup(struct socket *socket, struct mbuf *packet, int more) } else packet2 = packet; + s = spltdb(); if (!sbappendaddr(&socket->so_rcv, &pfkey_addr, packet2, NULL)) { m_freem(packet2); - return 0; + splx(s); + return ENOBUFS; } + splx(s); sorwakeup(socket); return 0; -- cgit v1.2.3