]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d : Transformation changes for ospf6 vrf support. 7261/head
authorharios_niral <hari@niralnetworks.com>
Mon, 2 Nov 2020 16:24:21 +0000 (08:24 -0800)
committerharios_niral <hari@niralnetworks.com>
Mon, 2 Nov 2020 16:24:21 +0000 (08:24 -0800)
1. Reviews comments taken care.

Signed-off-by: harios_niral <hari@niralnetworks.com>
ospf6d/ospf6_asbr.c
ospf6d/ospf6_route.c

index 8f8f553af90129953b632b86ff8df792f663589a..8a467716ffc9374e905b93475147ac20f43ebf4f 100644 (file)
@@ -951,54 +951,50 @@ static void ospf6_asbr_routemap_update(const char *mapname)
 
        for (ALL_LIST_ELEMENTS(om6->ospf6, node, nnode, ospf6)) {
                for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
-                       if (ospf6->rmap[type].name) {
-                               ospf6->rmap[type].map =
-                                       route_map_lookup_by_name(
-                                               ospf6->rmap[type].name);
-
-                               if (mapname
-                                   && (strcmp(ospf6->rmap[type].name, mapname)
-                                       == 0)) {
-                                       if (ospf6->rmap[type].map) {
-                                               if (IS_OSPF6_DEBUG_ASBR)
-                                                       zlog_debug(
-                                                               "%s: route-map %s update, reset redist %s",
-                                                               __func__,
-                                                               mapname,
-                                                               ZROUTE_NAME(
-                                                                       type));
-
-                                               route_map_counter_increment(
+                       if (ospf6->rmap[type].name == NULL)
+                               continue;
+                       ospf6->rmap[type].map = route_map_lookup_by_name(
+                                       ospf6->rmap[type].name);
+
+                       if (mapname == NULL || strcmp(ospf6->rmap[type].name, mapname))
+                               continue;
+                       if (ospf6->rmap[type].map) {
+                               if (IS_OSPF6_DEBUG_ASBR)
+                                       zlog_debug(
+                                                       "%s: route-map %s update, reset redist %s",
+                                                       __func__,
+                                                       mapname,
+                                                       ZROUTE_NAME(
+                                                               type));
+
+                                       route_map_counter_increment(
                                                        ospf6->rmap[type].map);
 
-                                               ospf6_asbr_distribute_list_update(
+                                       ospf6_asbr_distribute_list_update(
                                                        type, ospf6);
-                                       } else {
-                                               /*
-                                                * if the mapname matches a
-                                                * route-map on ospf6 but the
-                                                * map doesn't exist, it is
-                                                * being deleted. flush and then
-                                                * readvertise
-                                                */
-                                               if (IS_OSPF6_DEBUG_ASBR)
-                                                       zlog_debug(
-                                                               "%s: route-map %s deleted, reset redist %s",
-                                                               __func__,
-                                                               mapname,
-                                                               ZROUTE_NAME(
-                                                                       type));
-                                               ospf6_asbr_redistribute_unset(
-                                                       type, ospf6->vrf_id);
-                                               ospf6_asbr_routemap_set(
-                                                       type, mapname,
-                                                       ospf6->vrf_id);
-                                               ospf6_asbr_redistribute_set(
-                                                       type, ospf6->vrf_id);
-                                       }
-                               }
-                       } else
-                               ospf6->rmap[type].map = NULL;
+                       } else {
+                               /*
+                               * if the mapname matches a
+                               * route-map on ospf6 but the
+                               * map doesn't exist, it is
+                               * being deleted. flush and then
+                               * readvertise
+                               */
+                               if (IS_OSPF6_DEBUG_ASBR)
+                                       zlog_debug(
+                                                       "%s: route-map %s deleted, reset redist %s",
+                                                       __func__,
+                                                       mapname,
+                                                       ZROUTE_NAME(
+                                                               type));
+                               ospf6_asbr_redistribute_unset(
+                                               type, ospf6->vrf_id);
+                               ospf6_asbr_routemap_set(
+                                               type, mapname,
+                                               ospf6->vrf_id);
+                               ospf6_asbr_redistribute_set(
+                                               type, ospf6->vrf_id);
+                       }
                }
        }
 }
index 038a6394446847c96710d608bd331bf0af2d1ba2..374acd7b5f1c3e0ebebf74e14a8206628c061424 100644 (file)
@@ -1084,7 +1084,7 @@ void ospf6_route_show(struct vty *vty, struct ospf6_route *route)
 
 void ospf6_route_show_detail(struct vty *vty, struct ospf6_route *route)
 {
-       char destination[PREFIX2STR_BUFFER], nexthop[64];
+       char destination[PREFIX2STR_BUFFER];
        char area_id[16], id[16], adv_router[16], capa[16], options[16];
        struct timeval now, res;
        char duration[64];
@@ -1170,10 +1170,9 @@ void ospf6_route_show_detail(struct vty *vty, struct ospf6_route *route)
        for (ALL_LIST_ELEMENTS_RO(route->nh_list, node, nh)) {
                struct interface *ifp;
                /* nexthop */
-               inet_ntop(AF_INET6, &nh->address, nexthop, sizeof(nexthop));
 
                ifp = if_lookup_by_index_all_vrf(nh->ifindex);
-               vty_out(vty, "  %s %.*s\n", nexthop, IFNAMSIZ, ifp->name);
+               vty_out(vty, "  %pI6 %.*s\n", &nh->address, IFNAMSIZ, ifp->name);
        }
        vty_out(vty, "\n");
 }