]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
The hwaddr could have changed for existing interfaces.
authorRoy Marples <roy@marples.name>
Thu, 15 Oct 2009 07:33:24 +0000 (07:33 +0000)
committerRoy Marples <roy@marples.name>
Thu, 15 Oct 2009 07:33:24 +0000 (07:33 +0000)
dhcpcd.c

index a207eefcf2192939f0e9ffa87c7d396db98b1089..c41488d3b3623d19ca197efdc949f7dde1d24f3f 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1229,13 +1229,19 @@ handle_interface(int action, const char *ifname)
                                break;
                        ifl = ifn;
                }
-               if (ifn)
-                       continue;
+               if (ifn) {
+                       /* The flags and hwaddr could have changed */
+                       ifn->flags = ifp->flags;
+                       ifn->hwlen = ifp->hwlen;
+                       if (ifp->hwlen != 0)
+                               memcpy(ifn->hwaddr, ifp->hwaddr, ifn->hwlen);
+               } else {
+                       if (ifl)
+                               ifl->next = ifp;
+                       else
+                               ifaces = ifp;
+               }
                init_state(ifp, 0, NULL);
-               if (ifl)
-                       ifl->next = ifp;
-               else
-                       ifaces = ifp;
                start_interface(ifp);
        }
 }