]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: handle missing link local address more gracefully
authorChristian Franke <chris@opensourcerouting.org>
Thu, 13 Dec 2012 15:11:16 +0000 (16:11 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 18 Mar 2014 07:45:20 +0000 (08:45 +0100)
ospf6 can't run on an interface without a link local address.
Don't start the state machine when an interface comes up without
such an ip and bring it up later, when a usable link local
address is added.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospf6d/ospf6_interface.c
ospf6d/ospf6_zebra.c

index d9d2d03b08382c978ce576c04bcde8dc5dbdc007..8d4276458db323a4cfcac6434bd17f2bf4df1436 100644 (file)
@@ -287,8 +287,7 @@ ospf6_interface_if_add (struct interface *ifp)
     }
 
   /* interface start */
-  if (oi->area)
-    thread_add_event (master, interface_up, oi, 0);
+  ospf6_interface_state_update(oi->interface);
 }
 
 void
@@ -327,7 +326,9 @@ ospf6_interface_state_update (struct interface *ifp)
   if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_DISABLE))
     return;
 
-  if (if_is_operative (ifp))
+  if (if_is_operative (ifp)
+      && (ospf6_interface_get_linklocal_address(oi->interface)
+          || if_is_loopback(oi->interface)))
     thread_add_event (master, interface_up, oi, 0);
   else
     thread_add_event (master, interface_down, oi, 0);
@@ -647,6 +648,16 @@ interface_up (struct thread *thread)
       return 0;
     }
 
+  /* check interface has a link-local address */
+  if (! (ospf6_interface_get_linklocal_address(oi->interface)
+         || if_is_loopback(oi->interface)))
+    {
+      if (IS_OSPF6_DEBUG_INTERFACE)
+       zlog_debug ("Interface %s has no link local address, can't execute [InterfaceUp]",
+                   oi->interface->name);
+       return 0;
+    }
+
   /* if already enabled, do nothing */
   if (oi->state > OSPF6_INTERFACE_DOWN)
     {
index 50ecc170093178e2535409b02c2ef01f5d4e8eea..cffd7675f870001f842f65d7bcf8699d57614078 100644 (file)
@@ -165,8 +165,10 @@ ospf6_zebra_if_address_update_add (int command, struct zclient *zclient,
                           buf, sizeof (buf)), c->address->prefixlen);
 
   if (c->address->family == AF_INET6)
-    ospf6_interface_connected_route_update (c->ifp);
-
+    {
+      ospf6_interface_state_update (c->ifp);
+      ospf6_interface_connected_route_update (c->ifp);
+    }
   return 0;
 }
 
@@ -188,7 +190,10 @@ ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient,
                           buf, sizeof (buf)), c->address->prefixlen);
 
   if (c->address->family == AF_INET6)
-    ospf6_interface_connected_route_update (c->ifp);
+    {
+      ospf6_interface_connected_route_update (c->ifp);
+      ospf6_interface_state_update (c->ifp);
+    }
 
   return 0;
 }