nd6: prevent ln from being freed while releasing held packets
This commit is contained in:
parent
e1d1003b4c
commit
de6f3b09a6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nd6.c,v 1.276 2020/12/28 20:19:50 nia Exp $ */
|
||||
/* $NetBSD: nd6.c,v 1.277 2021/08/17 09:43:21 ozaki-r Exp $ */
|
||||
/* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.276 2020/12/28 20:19:50 nia Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.277 2021/08/17 09:43:21 ozaki-r Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_compat_netbsd.h"
|
||||
|
@ -1305,6 +1305,7 @@ nd6_llinfo_release_pkts(struct llentry *ln, struct ifnet *ifp)
|
|||
|
||||
m_hold = ln->la_hold, ln->la_hold = NULL, ln->la_numheld = 0;
|
||||
|
||||
LLE_ADDREF(ln);
|
||||
LLE_WUNLOCK(ln);
|
||||
for (; m_hold != NULL; m_hold = m_hold_next) {
|
||||
m_hold_next = m_hold->m_nextpkt;
|
||||
|
@ -1318,6 +1319,7 @@ nd6_llinfo_release_pkts(struct llentry *ln, struct ifnet *ifp)
|
|||
ip6_if_output(ifp, ifp, m_hold, &sin6, NULL);
|
||||
}
|
||||
LLE_WLOCK(ln);
|
||||
LLE_REMREF(ln);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue