summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_interface.c')
-rw-r--r--ospf6d/ospf6_interface.c78
1 files changed, 75 insertions, 3 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 26f68ac5..a52da720 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -392,6 +392,7 @@ ospf6_interface_connected_route_update (struct interface *ifp)
struct ospf6_route *route;
struct connected *c;
struct listnode *node, *nnode;
+ struct in6_addr nh_addr;
oi = (struct ospf6_interface *) ifp->info;
if (oi == NULL)
@@ -447,8 +448,8 @@ ospf6_interface_connected_route_update (struct interface *ifp)
route->path.area_id = oi->area->area_id;
route->path.type = OSPF6_PATH_TYPE_INTRA;
route->path.cost = oi->cost;
- route->nexthop[0].ifindex = oi->interface->ifindex;
- inet_pton (AF_INET6, "::1", &route->nexthop[0].address);
+ inet_pton (AF_INET6, "::1", &nh_addr);
+ ospf6_route_add_nexthop (route, oi->interface->ifindex, &nh_addr);
ospf6_route_add (route, oi->route_connected);
}
@@ -728,7 +729,18 @@ interface_up (struct thread *thread)
}
/* Join AllSPFRouters */
- ospf6_sso (oi->interface->ifindex, &allspfrouters6, IPV6_JOIN_GROUP);
+ if (ospf6_sso (oi->interface->ifindex, &allspfrouters6, IPV6_JOIN_GROUP) < 0)
+ {
+ if (oi->sso_try_cnt++ < OSPF6_INTERFACE_SSO_RETRY_MAX)
+ {
+ zlog_info("Scheduling %s for sso retry, trial count: %d",
+ oi->interface->name, oi->sso_try_cnt);
+ thread_add_timer (master, interface_up, oi,
+ OSPF6_INTERFACE_SSO_RETRY_INT);
+ }
+ return 0;
+ }
+ oi->sso_try_cnt = 0; /* Reset on success */
/* Update interface route */
ospf6_interface_connected_route_update (oi->interface);
@@ -1915,6 +1927,66 @@ ospf6_interface_init (void)
install_element (OSPF6_NODE, &no_auto_cost_reference_bandwidth_cmd);
}
+/* Clear the specified interface structure */
+static void
+ospf6_interface_clear (struct vty *vty, struct interface *ifp)
+{
+ struct ospf6_interface *oi;
+
+ if (!if_is_operative (ifp))
+ return;
+
+ if (ifp->info == NULL)
+ return;
+
+ oi = (struct ospf6_interface *) ifp->info;
+
+ if (IS_OSPF6_DEBUG_INTERFACE)
+ zlog_debug ("Interface %s: clear by reset", ifp->name);
+
+ /* Reset the interface */
+ thread_add_event (master, interface_down, oi, 0);
+ thread_add_event (master, interface_up, oi, 0);
+}
+
+/* Clear interface */
+DEFUN (clear_ipv6_ospf6_interface,
+ clear_ipv6_ospf6_interface_cmd,
+ "clear ipv6 ospf6 interface [IFNAME]",
+ CLEAR_STR
+ IP6_STR
+ OSPF6_STR
+ INTERFACE_STR
+ IFNAME_STR
+ )
+{
+ struct interface *ifp;
+ struct listnode *node;
+
+ if (argc == 0) /* Clear all the ospfv3 interfaces. */
+ {
+ for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ ospf6_interface_clear (vty, ifp);
+ }
+ else /* Interface name is specified. */
+ {
+ if ((ifp = if_lookup_by_name (argv[0])) == NULL)
+ {
+ vty_out (vty, "No such Interface: %s%s", argv[0], VNL);
+ return CMD_WARNING;
+ }
+ ospf6_interface_clear (vty, ifp);
+ }
+
+ return CMD_SUCCESS;
+}
+
+void
+install_element_ospf6_clear_interface (void)
+{
+ install_element (ENABLE_NODE, &clear_ipv6_ospf6_interface_cmd);
+}
+
DEFUN (debug_ospf6_interface,
debug_ospf6_interface_cmd,
"debug ospf6 interface",