Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 make sure rcvif is sane on call to icmp6_reflect



details:   https://anonhg.NetBSD.org/src/rev/6e8690ca7cf0
branches:  trunk
changeset: 507957:6e8690ca7cf0
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Apr 04 06:28:40 2001 +0000

description:
make sure rcvif is sane on call to icmp6_reflect

diffstat:

 sys/netinet6/icmp6.c |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 9d8f1fc614cf -r 6e8690ca7cf0 sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Wed Apr 04 05:31:57 2001 +0000
+++ b/sys/netinet6/icmp6.c      Wed Apr 04 06:28:40 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.62 2001/03/30 11:08:56 itojun Exp $        */
+/*     $NetBSD: icmp6.c,v 1.63 2001/04/04 06:28:41 itojun Exp $        */
 /*     $KAME: icmp6.c,v 1.204 2001/03/20 02:44:39 itojun Exp $ */
 
 /*
@@ -379,6 +379,15 @@
        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*/
 



Home | Main Index | Thread Index | Old Index