When an interface doesn't have a layer 2 address in6_get_ifid()
    tries to "borrow" one from another interface.
    But then it checks if the U bit is set int the generated EUI64
    address and rejects it.
    On the other hand for interfaces that do have a layer 2 address this
    check is skipped, so relax it for the "borrowing" case, too.
    
    With this one gets stable link local addresses on e.g. gre(4)
    interfaces on certain virtualisation environments depending which mac
    addresses get picked for the vio(4) interfaces while previously we
    would end up with a random IP on every reboot.
    
    Reported by Aaron A. Glenn via phessler.
    
diff --git in6_ifattach.c in6_ifattach.c
index 41410046d18..f40b1905fe4 100644
--- in6_ifattach.c
+++ in6_ifattach.c
@@ -277,19 +277,8 @@ in6_get_ifid(struct ifnet *ifp0, struct in6_addr *in6)
        TAILQ_FOREACH(ifp, &ifnet, if_list) {
                if (ifp == ifp0)
                        continue;
-               if (in6_get_hw_ifid(ifp, in6) != 0)
-                       continue;
-
-               /*
-                * to borrow ifid from other interface, ifid needs to be
-                * globally unique
-                */
-               if (IFID_UNIVERSAL(in6)) {
-                       nd6log((LOG_DEBUG,
-                           "%s: borrow interface identifier from %s\n",
-                           ifp0->if_xname, ifp->if_xname));
+               if (in6_get_hw_ifid(ifp, in6) == 0)
                        goto success;
-               }
        }
 
        /* last resort: get from random number source */


-- 
I'm not entirely sure you are real.

Reply via email to