summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-05-13 11:44:37 +0000
committerglebius <glebius@FreeBSD.org>2005-05-13 11:44:37 +0000
commit407f5f009c8e5a70c5fa5d8f7e21fbb26dfb71c0 (patch)
tree76265ac0cffc6819728a043ed0dc1328014084d9 /sys/netinet/ip_divert.c
parent23a1a3e3a9990e5ecf82fb73e1b5fd7a01d3a2a3 (diff)
downloadFreeBSD-src-407f5f009c8e5a70c5fa5d8f7e21fbb26dfb71c0.zip
FreeBSD-src-407f5f009c8e5a70c5fa5d8f7e21fbb26dfb71c0.tar.gz
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.
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 434bb59..65e7376 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 */
OpenPOWER on IntegriCloud