Don't try to forward link-local addresses

This commit is contained in:
goldsimon 2010-03-06 10:15:39 +00:00
parent 4649c14856
commit 5d4438e652
2 changed files with 12 additions and 0 deletions

View File

@ -141,6 +141,9 @@ HISTORY
++ Bugfixes:
2010-03-06: Simon Goldschmidt
* ipv4/ip.c: Don't try to forward link-local addresses
2010-03-06: Simon Goldschmidt
* etharp.c: Fixed bug #29087: etharp: don't send packets for LinkLocal-
addresses to gw

View File

@ -122,6 +122,15 @@ ip_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp)
PERF_START;
dest = iphdr->dest;
/* RFC3927 2.7: do not forward link-local addresses */
if (ip_addr_islinklocal(&dest)) {
LWIP_DEBUGF(IP_DEBUG, ("ip_forward: not forwarding LLA %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
ip4_addr1_16(&dest), ip4_addr2_16(&dest), ip4_addr3_16(&dest), ip4_addr4_16(&dest)));
snmp_inc_ipoutnoroutes();
return (struct netif *)NULL;
}
/* Find network interface where to forward this IP packet to. */
netif = ip_route(&dest);
if (netif == NULL) {