diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-04-04 06:03:46 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-04-04 06:03:46 +0000 |
commit | b2cb2b248d5ed79f5a47312cfd6ecc01f9a00e92 (patch) | |
tree | 1c74fe32d3ba692b273b5840740352a0ec5163a9 /sys/netinet6/icmp6.c | |
parent | 47441326949f48cc9db8a0c08f85f58742a0c09b (diff) |
make sure rcvif is not bogus, on call to icmp6_reflect.
Diffstat (limited to 'sys/netinet6/icmp6.c')
-rw-r--r-- | sys/netinet6/icmp6.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 3a3612b47ae..99f1df22bf4 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.38 2001/03/30 11:08:58 itojun Exp $ */ +/* $OpenBSD: icmp6.c,v 1.39 2001/04/04 06:03:45 itojun Exp $ */ /* $KAME: icmp6.c,v 1.205 2001/03/21 07:48:57 itojun Exp $ */ /* @@ -398,6 +398,15 @@ icmp6_error(m, type, code, param) icmp6->icmp6_code = code; icmp6->icmp6_pptr = htonl((u_int32_t)param); + /* + * icmp6_reflect() is designed to be in the input path. + * icmp6_error() can be called from both input and outut path, + * and if we are in output path rcvif could contain bogus value. + * clear m->m_pkthdr.rcvif for safety, we should have enough scope + * information in ip header (nip6). + */ + m->m_pkthdr.rcvif = NULL; + icmp6stat.icp6s_outhist[type]++; icmp6_reflect(m, sizeof(struct ip6_hdr)); /*header order: IPv6 - ICMPv6*/ |