summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-05-21 23:15:23 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-05-21 23:15:23 +0000
commit6c58cbc307f2a3f9ed1df1335c8eebe774c1a109 (patch)
tree2411772e12a795578075c4a0daca6a7bbb31961a /sys/net
parent441230f88eb52180360e4199b75a694d54ac1d10 (diff)
For hard expiration-pressure you need to protect PF_KEY socket
queueing with spltdb()
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pfkey.c6
1 files changed, 5 insertions, 1 deletions
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;