From ab29ef8091ae52394d36c9d1bc9570b254e4b013 Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Sun, 31 Mar 2013 11:18:36 +0000 Subject: The call to in_pcballoc() in user request attach was handled in three different ways. Use the same code in udp_usrreq() and rip_usrreq() and rip6_usrreq(). This also fixes a pcb and socket leak in udp_usrreq() in case soreserve() fails. Put an splsoftassert() into in_pcballoc() for safety. OK mpi@ --- sys/netinet/in_pcb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/netinet/in_pcb.c') diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index cf64629aaf5..3b67f7fcfd2 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.134 2013/03/29 13:16:14 bluhm Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.135 2013/03/31 11:18:35 bluhm Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -177,6 +177,8 @@ in_pcballoc(struct socket *so, struct inpcbtable *table) struct inpcb *inp; int s; + splsoftassert(IPL_SOFTNET); + if (inpcb_pool_initialized == 0) { pool_init(&inpcb_pool, sizeof(struct inpcb), 0, 0, 0, "inpcbpl", NULL); -- cgit v1.2.3