mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
routing: plug mbuf leak for the packets hitting IPv6 blackhole route
Reported by: Dmitriy Smirnov <fox@sage.su> Tested by: Dmitriy Smirnov <fox@sage.su> MFC after: 1 day
This commit is contained in:
parent
4c63ecf5c7
commit
b50e1465e8
|
@ -198,9 +198,12 @@ ip6_forward(struct mbuf *m, int srcrt)
|
|||
|
||||
if (nh->nh_flags & (NHF_BLACKHOLE | NHF_REJECT)) {
|
||||
IP6STAT_INC(ip6s_cantforward);
|
||||
if ((nh->nh_flags & NHF_REJECT) && (mcopy != NULL)) {
|
||||
icmp6_error(mcopy, ICMP6_DST_UNREACH,
|
||||
ICMP6_DST_UNREACH_REJECT, 0);
|
||||
if (mcopy != NULL) {
|
||||
if (nh->nh_flags & NHF_REJECT) {
|
||||
icmp6_error(mcopy, ICMP6_DST_UNREACH,
|
||||
ICMP6_DST_UNREACH_REJECT, 0);
|
||||
} else
|
||||
m_freem(mcopy);
|
||||
}
|
||||
goto bad;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue