task #10241 (AutoIP: don't break existing connections when assiging routable address): when checking incoming packets and aborting existing connection on address change, filter out link-local addresses.

This commit is contained in:
goldsimon 2010-03-08 18:17:52 +00:00
parent d47a04456b
commit 2a2be49d2c
3 changed files with 19 additions and 2 deletions

View File

@ -158,6 +158,12 @@ HISTORY
++ Bugfixes:
2010-03-08: Simon Goldschmidt
* netif.c, ipv4/ip.c: task #10241 (AutoIP: don't break existing connections
when assiging routable address): when checking incoming packets and
aborting existing connection on address change, filter out link-local
addresses.
2010-03-06: Simon Goldschmidt
* sockets.c: Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING

View File

@ -296,7 +296,13 @@ 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)) {
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 */
) {
LWIP_DEBUGF(IP_DEBUG, ("ip_input: packet accepted on interface %c%c\n",
netif->name[0], netif->name[1]));
/* break out of for loop */

View File

@ -331,7 +331,12 @@ netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)
pcb = tcp_active_pcbs;
while (pcb != NULL) {
/* PCB bound to current local interface address? */
if (ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))) {
if (ip_addr_cmp(&(pcb->local_ip), &(netif->ip_addr))
#if LWIP_AUTOIP
/* connections to link-local addresses must persist (RFC3927 ch. 1.9) */
&& !ip_addr_islinklocal(&(pcb->local_ip))
#endif /* LWIP_AUTOIP */
) {
/* this connection must be aborted */
struct tcp_pcb *next = pcb->next;
LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb));