]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_zebra.c
Merge pull request #2267 from donaldsharp/flim_flam
[mirror_frr.git] / ospf6d / ospf6_zebra.c
index 2a419ddfc616ff927d406d9a79083e81c3330434..8458d19952e0ad5b64303f217b46a53dcb5f7ec4 100644 (file)
@@ -46,8 +46,6 @@ unsigned char conf_debug_ospf6_zebra = 0;
 /* information about zebra. */
 struct zclient *zclient = NULL;
 
-struct in_addr router_id_zebra;
-
 /* Router-id update message from zebra. */
 static int ospf6_router_id_update_zebra(int command, struct zclient *zclient,
                                        zebra_size_t length, vrf_id_t vrf_id)
@@ -56,13 +54,23 @@ static int ospf6_router_id_update_zebra(int command, struct zclient *zclient,
        struct ospf6 *o = ospf6;
 
        zebra_router_id_update_read(zclient->ibuf, &router_id);
-       router_id_zebra = router_id.u.prefix4;
+
+       om6->zebra_router_id = router_id.u.prefix4.s_addr;
 
        if (o == NULL)
                return 0;
 
-       if (o->router_id == 0)
-               o->router_id = (u_int32_t)router_id_zebra.s_addr;
+       o->router_id_zebra = router_id.u.prefix4;
+       if (IS_OSPF6_DEBUG_ZEBRA(RECV)) {
+               char buf[INET_ADDRSTRLEN];
+
+               zlog_debug("%s: zebra router-id %s update",
+                          __PRETTY_FUNCTION__,
+                          inet_ntop(AF_INET, &router_id.u.prefix4,
+                                    buf, INET_ADDRSTRLEN));
+       }
+
+       ospf6_router_id_update();
 
        return 0;
 }
@@ -119,13 +127,6 @@ static int ospf6_zebra_if_del(int command, struct zclient *zclient,
                zlog_debug("Zebra Interface delete: %s index %d mtu %d",
                           ifp->name, ifp->ifindex, ifp->mtu6);
 
-#if 0
-  /* XXX: ospf6_interface_if_del is not the right way to handle this,
-   * because among other thinkable issues, it will also clear all
-   * settings as they are contained in the struct ospf6_interface. */
-  ospf6_interface_if_del (ifp);
-#endif /*0*/
-
        if_set_index(ifp, IFINDEX_INTERNAL);
        return 0;
 }
@@ -337,7 +338,6 @@ static void ospf6_zebra_route_update(int type, struct ospf6_route *request)
 
        memset(&api, 0, sizeof(api));
        api.vrf_id = VRF_DEFAULT;
-       api.nh_vrf_id = VRF_DEFAULT;
        api.type = ZEBRA_ROUTE_OSPF6;
        api.safi = SAFI_UNICAST;
        api.prefix = *dest;
@@ -388,7 +388,6 @@ void ospf6_zebra_add_discard(struct ospf6_route *request)
        if (!CHECK_FLAG(request->flag, OSPF6_ROUTE_BLACKHOLE_ADDED)) {
                memset(&api, 0, sizeof(api));
                api.vrf_id = VRF_DEFAULT;
-               api.nh_vrf_id = VRF_DEFAULT;
                api.type = ZEBRA_ROUTE_OSPF6;
                api.safi = SAFI_UNICAST;
                api.prefix = *dest;
@@ -422,7 +421,6 @@ void ospf6_zebra_delete_discard(struct ospf6_route *request)
        if (CHECK_FLAG(request->flag, OSPF6_ROUTE_BLACKHOLE_ADDED)) {
                memset(&api, 0, sizeof(api));
                api.vrf_id = VRF_DEFAULT;
-               api.nh_vrf_id = VRF_DEFAULT;
                api.type = ZEBRA_ROUTE_OSPF6;
                api.safi = SAFI_UNICAST;
                api.prefix = *dest;
@@ -463,7 +461,7 @@ int ospf6_distance_set(struct vty *vty, struct ospf6 *o,
 {
        int ret;
        struct prefix_ipv6 p;
-       u_char distance;
+       uint8_t distance;
        struct route_node *rn;
        struct ospf6_distance *odistance;
 
@@ -548,7 +546,7 @@ void ospf6_distance_reset(struct ospf6 *o)
                }
 }
 
-u_char ospf6_distance_apply(struct prefix_ipv6 *p, struct ospf6_route * or)
+uint8_t ospf6_distance_apply(struct prefix_ipv6 *p, struct ospf6_route * or)
 {
        struct ospf6 *o;