mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-06 09:39:59 +00:00
ip_input: better check for old link-local-address (explicitly check for autoip->llipaddr instead of letting all link-local-addresses through)
This commit is contained in:
parent
2a2be49d2c
commit
d91caf1cd3
@ -52,6 +52,7 @@
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/autoip.h"
|
||||
#include "lwip/stats.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
@ -296,18 +297,23 @@ ip_input(struct pbuf *p, struct netif *inp)
|
||||
/* unicast to this interface address? */
|
||||
if (ip_addr_cmp(&(iphdr->dest), &(netif->ip_addr)) ||
|
||||
/* or broadcast on this interface network address? */
|
||||
ip_addr_isbroadcast(&(iphdr->dest), netif)
|
||||
#if LWIP_AUTOIP
|
||||
/* connections to link-local addresses must persist after changing
|
||||
the netif's address (RFC3927 ch. 1.9) */
|
||||
|| ip_addr_islinklocal(&(iphdr->dest))
|
||||
#endif /* LWIP_AUTOIP */
|
||||
) {
|
||||
ip_addr_isbroadcast(&(iphdr->dest), netif)) {
|
||||
LWIP_DEBUGF(IP_DEBUG, ("ip_input: packet accepted on interface %c%c\n",
|
||||
netif->name[0], netif->name[1]));
|
||||
/* break out of for loop */
|
||||
break;
|
||||
}
|
||||
#if LWIP_AUTOIP
|
||||
/* connections to link-local addresses must persist after changing
|
||||
the netif's address (RFC3927 ch. 1.9) */
|
||||
if ((netif->autoip != NULL) &&
|
||||
ip_addr_cmp(&(iphdr->dest), &(netif->autoip->llipaddr))) {
|
||||
LWIP_DEBUGF(IP_DEBUG, ("ip_input: LLA packet accepted on interface %c%c\n",
|
||||
netif->name[0], netif->name[1]));
|
||||
/* break out of for loop */
|
||||
break;
|
||||
}
|
||||
#endif /* LWIP_AUTOIP */
|
||||
}
|
||||
if (first) {
|
||||
first = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user