summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2000-02-28 14:30:40 +0000
committeritojun <itojun@openbsd.org>2000-02-28 14:30:40 +0000
commit8a3a91176ca27942be4f52a90a60cf66a4ee989f (patch)
tree3971e95cef59cc45bf05703689ce849e302ab03b /sys/netinet6
parentRegen. (diff)
downloadwireguard-openbsd-8a3a91176ca27942be4f52a90a60cf66a4ee989f.tar.xz
wireguard-openbsd-8a3a91176ca27942be4f52a90a60cf66a4ee989f.zip
fix ICMPv6 redirect input. the bug can result in invalid ND entry.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/icmp6.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 69a705e0a48..c056e23f04e 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.8 2000/02/28 14:05:59 itojun Exp $ */
+/* $OpenBSD: icmp6.c,v 1.9 2000/02/28 14:30:40 itojun Exp $ */
/* $KAME: icmp6.c,v 1.71 2000/02/28 09:25:42 jinmei Exp $ */
/*
@@ -1544,11 +1544,6 @@ icmp6_redirect_input(m, off)
if (!icmp6_rediraccept)
goto freeit;
- if (IN6_IS_ADDR_LINKLOCAL(&redtgt6))
- redtgt6.s6_addr16[1] = htons(ifp->if_index);
- if (IN6_IS_ADDR_LINKLOCAL(&reddst6))
- reddst6.s6_addr16[1] = htons(ifp->if_index);
-
#ifndef PULLDOWN_TEST
IP6_EXTHDR_CHECK(m, off, icmp6len,);
nd_rd = (struct nd_redirect *)((caddr_t)ip6 + off);
@@ -1562,6 +1557,11 @@ icmp6_redirect_input(m, off)
redtgt6 = nd_rd->nd_rd_target;
reddst6 = nd_rd->nd_rd_dst;
+ if (IN6_IS_ADDR_LINKLOCAL(&redtgt6))
+ redtgt6.s6_addr16[1] = htons(ifp->if_index);
+ if (IN6_IS_ADDR_LINKLOCAL(&reddst6))
+ reddst6.s6_addr16[1] = htons(ifp->if_index);
+
/* validation */
if (!IN6_IS_ADDR_LINKLOCAL(&src6)) {
log(LOG_ERR,