]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_interface.c
Merge pull request #8639 from idryzhov/isis-new-bfd-lib
[mirror_frr.git] / ripngd / ripng_interface.c
index 3fac88514186b4f20850e6e36075bccb13d26488..11a8fdff87e338959b2886d702cb751e20f3d451 100644 (file)
@@ -49,7 +49,7 @@
 #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
 #endif
 
-DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_IF, "ripng interface")
+DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_IF, "ripng interface");
 
 /* Static utility function. */
 static void ripng_enable_apply(struct interface *);
@@ -274,10 +274,11 @@ static int ripng_ifp_destroy(struct interface *ifp)
                ripng_if_down(ifp);
        }
 
-       zlog_info(
-               "interface delete %s vrf %s(%u) index %d flags %#llx metric %d mtu %d",
-               ifp->name, VRF_LOGNAME(vrf), ifp->vrf_id, ifp->ifindex,
-               (unsigned long long)ifp->flags, ifp->metric, ifp->mtu6);
+       if (IS_RIPNG_DEBUG_ZEBRA)
+               zlog_debug(
+                       "interface delete %s vrf %s(%u) index %d flags %#llx metric %d mtu %d",
+                       ifp->name, VRF_LOGNAME(vrf), ifp->vrf_id, ifp->ifindex,
+                       (unsigned long long)ifp->flags, ifp->metric, ifp->mtu6);
 
        return 0;
 }
@@ -320,10 +321,7 @@ void ripng_interface_clean(struct ripng *ripng)
                ri->enable_interface = 0;
                ri->running = 0;
 
-               if (ri->t_wakeup) {
-                       thread_cancel(ri->t_wakeup);
-                       ri->t_wakeup = NULL;
-               }
+               thread_cancel(&ri->t_wakeup);
        }
 }
 
@@ -374,8 +372,7 @@ int ripng_interface_address_add(ZAPI_CALLBACK_ARGS)
                struct ripng_interface *ri = c->ifp->info;
 
                if (IS_RIPNG_DEBUG_ZEBRA)
-                       zlog_debug("RIPng connected address %s/%d add",
-                                  inet6_ntoa(p->u.prefix6), p->prefixlen);
+                       zlog_debug("RIPng connected address %pFX add", p);
 
                /* Check is this prefix needs to be redistributed. */
                ripng_apply_address_add(c);
@@ -427,7 +424,6 @@ int ripng_interface_address_delete(ZAPI_CALLBACK_ARGS)
 {
        struct connected *ifc;
        struct prefix *p;
-       char buf[INET6_ADDRSTRLEN];
 
        ifc = zebra_interface_address_read(ZEBRA_INTERFACE_ADDRESS_DELETE,
                                           zclient->ibuf, vrf_id);
@@ -438,10 +434,8 @@ int ripng_interface_address_delete(ZAPI_CALLBACK_ARGS)
                if (p->family == AF_INET6) {
                        if (IS_RIPNG_DEBUG_ZEBRA)
                                zlog_debug(
-                                       "RIPng connected address %s/%d delete",
-                                       inet_ntop(AF_INET6, &p->u.prefix6, buf,
-                                                 INET6_ADDRSTRLEN),
-                                       p->prefixlen);
+                                       "RIPng connected address %pFX delete",
+                                       p);
 
                        /* Check wether this prefix needs to be removed. */
                        ripng_apply_address_del(ifc);
@@ -954,10 +948,14 @@ static int interface_config_write(struct vty *vty)
        return write;
 }
 
+static int interface_config_write(struct vty *vty);
 /* ripngd's interface node. */
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
+       .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
+       .config_write = interface_config_write,
 };
 
 /* Initialization of interface. */
@@ -968,7 +966,7 @@ void ripng_if_init(void)
        hook_register_prio(if_del, 0, ripng_if_delete_hook);
 
        /* Install interface node. */
-       install_node(&interface_node, interface_config_write);
+       install_node(&interface_node);
        if_cmd_init();
        if_zapi_callbacks(ripng_ifp_create, ripng_ifp_up,
                          ripng_ifp_down, ripng_ifp_destroy);