diff options
author | suz <suz@FreeBSD.org> | 2003-03-29 08:31:28 +0000 |
---|---|---|
committer | suz <suz@FreeBSD.org> | 2003-03-29 08:31:28 +0000 |
commit | 98b3db7ecaedf32ca9c418f3d2e1b18d911b8864 (patch) | |
tree | 24be009fb985e077479d4d54b94d9cc89e4a54bb /sys/netinet6 | |
parent | 17572bf81ce7a80b29d6c0e015977079bcb2b654 (diff) | |
download | FreeBSD-src-98b3db7ecaedf32ca9c418f3d2e1b18d911b8864.zip FreeBSD-src-98b3db7ecaedf32ca9c418f3d2e1b18d911b8864.tar.gz |
fixed a mbuf leak when an IP packet from ESP tunnel is redirected
obtained from: KAME
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/icmp6.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 4cbef25..1b79780 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -2661,10 +2661,17 @@ nolladdropt:; m->m_pkthdr.len = m->m_len = p - (u_char *)ip6; /* connect m0 to m */ + m_tag_delete_chain(m0, NULL); + m0->m_flags &= ~M_PKTHDR; m->m_next = m0; m->m_pkthdr.len = m->m_len + m0->m_len; + m0 = NULL; } noredhdropt:; + if (m0) { + m_freem(m0); + m0 = NULL; + } if (IN6_IS_ADDR_LINKLOCAL(&sip6->ip6_src)) sip6->ip6_src.s6_addr16[1] = 0; |