diff options
author | glebius <glebius@FreeBSD.org> | 2005-05-13 11:44:37 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-05-13 11:44:37 +0000 |
commit | 407f5f009c8e5a70c5fa5d8f7e21fbb26dfb71c0 (patch) | |
tree | 76265ac0cffc6819728a043ed0dc1328014084d9 | |
parent | 23a1a3e3a9990e5ecf82fb73e1b5fd7a01d3a2a3 (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/netinet/ip_divert.c | 5 |
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 */ |