summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-03-16 12:20:53 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-03-16 12:20:53 +0000
commit837c5c9df068deee023d3b776e126c30ef71f7b3 (patch)
tree6861c478d2d081eec3df205caf1b82ff34dd1a28 /sys
parentda17683f419f9b93963035edc743da37693fd21b (diff)
drop packets with link-local addresses,
if (internally-used) interface ID portion is already filled. sync with kame
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/ip6_input.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 9132853c49a..643bc290311 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_input.c,v 1.27 2001/02/16 16:38:15 itojun Exp $ */
+/* $OpenBSD: ip6_input.c,v 1.28 2001/03/16 12:20:52 itojun Exp $ */
/* $KAME: ip6_input.c,v 1.176 2001/02/14 07:13:39 itojun Exp $ */
/*
@@ -330,6 +330,20 @@ ip6_input(m)
}
}
+ /* drop packets if interface ID portion is already filled */
+ if ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) {
+ if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src) &&
+ ip6->ip6_src.s6_addr16[1]) {
+ ip6stat.ip6s_badscope++;
+ goto bad;
+ }
+ if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst) &&
+ ip6->ip6_dst.s6_addr16[1]) {
+ ip6stat.ip6s_badscope++;
+ goto bad;
+ }
+ }
+
#ifndef FAKE_LOOPBACK_IF
if ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0)
#else