]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
task #10241 (AutoIP: don't break existing connections when assiging routable address...
authorgoldsimon <goldsimon>
Mon, 8 Mar 2010 18:17:52 +0000 (18:17 +0000)
committergoldsimon <goldsimon>
Mon, 8 Mar 2010 18:17:52 +0000 (18:17 +0000)
CHANGELOG
src/core/ipv4/ip.c
src/core/netif.c

index 0a9dbcbcb94bb3518eaacaf0d7734a63b5cd2808..8dd390d32fc7c3e769278455e36f96b1f68beb05 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
 
index 57c8f5528ed1201284c0211910ba972922fbefaa..e92c5431b2e90add44f68ee521b6577ee0f26388 100644 (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 */
index b5be77c6b1eca86e8f2d21dd884d8195ef78e0d0..0036842b92731301293a26bab81dca0bf5faa5da 100644 (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));