]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_zebra.c
Merge pull request #1625 from qlyoung/fix-peer-group-admin-shutdown-override
[mirror_frr.git] / ospf6d / ospf6_zebra.c
index 3443bc47b616acd3900294bbc4c3e1b4daeb71e7..cc87c499ee50af6e502bf382aa7907365adae65e 100644 (file)
@@ -126,7 +126,7 @@ static int ospf6_zebra_if_del(int command, struct zclient *zclient,
   ospf6_interface_if_del (ifp);
 #endif /*0*/
 
-       ifp->ifindex = IFINDEX_DELETED;
+       if_set_index(ifp, IFINDEX_INTERNAL);
        return 0;
 }
 
@@ -231,11 +231,7 @@ static int ospf6_zebra_read_route(int command, struct zclient *zclient,
                char prefixstr[PREFIX2STR_BUFFER], nexthopstr[128];
                prefix2str((struct prefix *)&api.prefix, prefixstr,
                           sizeof(prefixstr));
-               if (nexthop)
-                       inet_ntop(AF_INET6, nexthop, nexthopstr,
-                                 sizeof(nexthopstr));
-               else
-                       snprintf(nexthopstr, sizeof(nexthopstr), "::");
+               inet_ntop(AF_INET6, nexthop, nexthopstr, sizeof(nexthopstr));
 
                zlog_debug(
                        "Zebra Receive route %s: %s %s nexthop %s ifindex %ld tag %" ROUTE_TAG_PRI,
@@ -260,7 +256,7 @@ DEFUN (show_zebra,
        SHOW_STR
        IPV6_STR
        OSPF6_STR
-       "Zebra information\n")
+       ZEBRA_STR)
 {
        int i;
        if (zclient == NULL) {
@@ -345,8 +341,8 @@ static void ospf6_zebra_route_update(int type, struct ospf6_route *request)
        api.safi = SAFI_UNICAST;
        api.prefix = *dest;
        SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
-       api.nexthop_num = nhcount;
-       ospf6_route_zebra_copy_nexthops(request, api.nexthops, nhcount);
+       api.nexthop_num = MIN(nhcount, MULTIPATH_NUM);
+       ospf6_route_zebra_copy_nexthops(request, api.nexthops, api.nexthop_num);
        SET_FLAG(api.message, ZAPI_MESSAGE_METRIC);
        api.metric = (request->path.metric_type == 2 ? request->path.u.cost_e2
                                                     : request->path.cost);
@@ -392,9 +388,9 @@ void ospf6_zebra_add_discard(struct ospf6_route *request)
                memset(&api, 0, sizeof(api));
                api.vrf_id = VRF_DEFAULT;
                api.type = ZEBRA_ROUTE_OSPF6;
-               api.flags = ZEBRA_FLAG_BLACKHOLE;
                api.safi = SAFI_UNICAST;
                api.prefix = *dest;
+               zapi_route_set_blackhole(&api, BLACKHOLE_NULL);
 
                zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
 
@@ -425,9 +421,9 @@ void ospf6_zebra_delete_discard(struct ospf6_route *request)
                memset(&api, 0, sizeof(api));
                api.vrf_id = VRF_DEFAULT;
                api.type = ZEBRA_ROUTE_OSPF6;
-               api.flags = ZEBRA_FLAG_BLACKHOLE;
                api.safi = SAFI_UNICAST;
                api.prefix = *dest;
+               zapi_route_set_blackhole(&api, BLACKHOLE_NULL);
 
                zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
 
@@ -587,8 +583,8 @@ static void ospf6_zebra_connected(struct zclient *zclient)
 void ospf6_zebra_init(struct thread_master *master)
 {
        /* Allocate zebra structure. */
-       zclient = zclient_new(master);
-       zclient_init(zclient, ZEBRA_ROUTE_OSPF6, 0);
+       zclient = zclient_new_notify(master, &zclient_options_default);
+       zclient_init(zclient, ZEBRA_ROUTE_OSPF6, 0, &ospf6d_privs);
        zclient->zebra_connected = ospf6_zebra_connected;
        zclient->router_id_update = ospf6_router_id_update_zebra;
        zclient->interface_add = ospf6_zebra_if_add;