]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_top.c
bgpd, lib, ospf6d, vtysh: fix possible snprintf possible truncation
[mirror_frr.git] / ospf6d / ospf6_top.c
index 630b717fb3350082ab796bc12f6facacf799c5df..7bf099fbbfb2dd33bc0c008e41ca7a6812e12e88 100644 (file)
@@ -97,7 +97,8 @@ static void ospf6_top_route_hook_remove(struct ospf6_route *route)
 
 static void ospf6_top_brouter_hook_add(struct ospf6_route *route)
 {
-       if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
+       if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL) ||
+           IS_OSPF6_DEBUG_BROUTER) {
                uint32_t brouter_id;
                char brouter_name[16];
 
@@ -116,15 +117,17 @@ static void ospf6_top_brouter_hook_add(struct ospf6_route *route)
 
 static void ospf6_top_brouter_hook_remove(struct ospf6_route *route)
 {
-       if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
+       if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL) ||
+           IS_OSPF6_DEBUG_BROUTER) {
                uint32_t brouter_id;
                char brouter_name[16];
 
                brouter_id = ADV_ROUTER_IN_PREFIX(&route->prefix);
                inet_ntop(AF_INET, &brouter_id, brouter_name,
                          sizeof(brouter_name));
-               zlog_debug("%s: brouter %s del with nh count %u",
-                          __PRETTY_FUNCTION__, brouter_name,
+               zlog_debug("%s: brouter %p %s del with adv router %x nh %u",
+                          __PRETTY_FUNCTION__, (void *)route, brouter_name,
+                          route->path.origin.adv_router,
                           listcount(route->nh_list));
        }
        route->flag |= OSPF6_ROUTE_REMOVE;
@@ -365,7 +368,7 @@ DEFUN(ospf6_router_id,
        int idx = 0;
        int ret;
        const char *router_id_str;
-       u_int32_t router_id;
+       uint32_t router_id;
        struct ospf6_area *oa;
        struct listnode *node;
 
@@ -422,13 +425,13 @@ DEFUN(no_ospf6_router_id,
        return CMD_SUCCESS;
 }
 
-#if CONFDATE > 20180828
+#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180828
 CPP_NOTICE("ospf6: `router-id A.B.C.D` deprecated 2017/08/28")
 #endif
 ALIAS_HIDDEN(ospf6_router_id, ospf6_router_id_hdn_cmd, "router-id A.B.C.D",
             "Configure OSPF6 Router-ID\n" V4NOTATION_STR)
 
-#if CONFDATE > 20180828
+#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180828
 CPP_NOTICE("ospf6: `no router-id A.B.C.D` deprecated 2017/08/28")
 #endif
 ALIAS_HIDDEN(no_ospf6_router_id, no_ospf6_router_id_hdn_cmd,
@@ -663,7 +666,7 @@ DEFUN (ospf6_interface_area,
        struct ospf6_area *oa;
        struct ospf6_interface *oi;
        struct interface *ifp;
-       u_int32_t area_id;
+       uint32_t area_id;
 
        /* find/create ospf6 interface */
        ifp = if_get_by_name(argv[idx_ifname]->arg, VRF_DEFAULT, 0);
@@ -722,7 +725,7 @@ DEFUN (no_ospf6_interface_area,
        struct ospf6_interface *oi;
        struct ospf6_area *oa;
        struct interface *ifp;
-       u_int32_t area_id;
+       uint32_t area_id;
 
        ifp = if_lookup_by_name(argv[idx_ifname]->arg, VRF_DEFAULT);
        if (ifp == NULL) {