aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2005-05-13 11:44:37 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2005-05-13 11:44:37 +0000
commitb3cf6808ce32e66e8ec32183dc01c5aa84e84297 (patch)
tree76265ac0cffc6819728a043ed0dc1328014084d9 /sys/netinet/ip_divert.c
parent0f4a3524dd4c265831b8f73dbf0a77bf29dd8523 (diff)
downloadsrc-b3cf6808ce32e66e8ec32183dc01c5aa84e84297.tar.gz
src-b3cf6808ce32e66e8ec32183dc01c5aa84e84297.zip
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.
Notes
Notes: svn path=/head/; revision=146182
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 434bb5924139..65e7376537d4 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 */