From b3cf6808ce32e66e8ec32183dc01c5aa84e84297 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Fri, 13 May 2005 11:44:37 +0000 Subject: [PATCH] In div_output() explicitly set m->m_nextpkt to NULL. If divert socket is not userland, but ng_ksocket, then m->m_nextpkt may be non-NULL. In this case we would panic in sbappend. --- sys/netinet/ip_divert.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 434bb592413..65e7376537d 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -277,7 +277,12 @@ div_output(struct socket *so, struct mbuf *m, struct divert_tag *dt; int error = 0; + /* + * An mbuf may hasn't come from userland, but we pretend + * that it has. + */ m->m_pkthdr.rcvif = NULL; + m->m_nextpkt = NULL; if (control) m_freem(control); /* XXX */