From 289566afe84978f5452ee30946bd8d37899fb971 Mon Sep 17 00:00:00 2001 From: Ivan Delamer Date: Fri, 4 May 2012 18:25:22 -0600 Subject: [PATCH] In ip6_input(), do not accept link-local packets on netifs other than inp. Change-Id: I7f3c779e69292bc078890e0acdc37112559644ce --- src/core/ipv6/ip6.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index feed8c14..6a8cafe0 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -447,6 +447,11 @@ ip6_input(struct pbuf *p, struct netif *inp) } } } + if (ip6_addr_islinklocal(ip6_current_dest_addr())) { + /* Do not match link-local addresses to other netifs. */ + netif = NULL; + break; + } if (first) { first = 0; netif = netif_list; @@ -459,7 +464,7 @@ ip6_input(struct pbuf *p, struct netif *inp) } while(netif != NULL); netif_found: LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: packet accepted on interface %c%c\n", - netif->name[0], netif->name[1])); + netif ? netif->name[0] : 'X', netif? netif->name[1] : 'X')); } /* "::" packet source address? (used in duplicate address detection) */