]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripngd: fix "clear ipv6 ripng" command
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 8 Mar 2024 22:01:01 +0000 (00:01 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sat, 9 Mar 2024 10:16:38 +0000 (10:16 +0000)
mgmtd doesn't support YANG RPCs yet, so this command must go directly to
ripngd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit c544b9e8e72c3b77cca9d3d0ceaeae427b761f2c)

ripngd/ripng_cli.c
ripngd/ripngd.c
ripngd/subdir.am

index ed460a239e76dfa08fedfd8af0fd91e7c4a4ba7e..4806861fe08d0fce28ef177d4cb59f08cb736b5d 100644 (file)
@@ -512,36 +512,6 @@ void cli_show_ipv6_ripng_split_horizon(struct vty *vty,
        }
 }
 
-/*
- * XPath: /frr-ripngd:clear-ripng-route
- */
-DEFPY_YANG (clear_ipv6_rip,
-       clear_ipv6_rip_cmd,
-       "clear ipv6 ripng [vrf WORD]",
-       CLEAR_STR
-       IPV6_STR
-       "Clear IPv6 RIP database\n"
-       VRF_CMD_HELP_STR)
-{
-       struct list *input;
-       int ret;
-
-       input = list_new();
-       if (vrf) {
-               struct yang_data *yang_vrf;
-
-               yang_vrf = yang_data_new(
-                       "/frr-ripngd:clear-ripng-route/input/vrf", vrf);
-               listnode_add(input, yang_vrf);
-       }
-
-       ret = nb_cli_rpc(vty, "/frr-ripngd:clear-ripng-route", input, NULL);
-
-       list_delete(&input);
-
-       return ret;
-}
-
 DEFPY_YANG(
        ripng_ipv6_distribute_list, ripng_ipv6_distribute_list_cmd,
        "ipv6 distribute-list ACCESSLIST6_NAME$name <in|out>$dir [WORD$ifname]",
@@ -693,8 +663,6 @@ void ripng_cli_init(void)
 
        install_element(INTERFACE_NODE, &ipv6_ripng_split_horizon_cmd);
 
-       install_element(ENABLE_NODE, &clear_ipv6_rip_cmd);
-
        if_rmap_init(RIPNG_NODE);
 }
 
index f4dadf377df2a9e7e911ab8f3568ea7225d9fd01..80b9013e0f23caa357dea6a7a3011df49943365a 100644 (file)
@@ -2231,6 +2231,38 @@ DEFUN (show_ipv6_ripng_status,
        return CMD_SUCCESS;
 }
 
+#include "ripngd/ripngd_clippy.c"
+
+/*
+ * XPath: /frr-ripngd:clear-ripng-route
+ */
+DEFPY_YANG (clear_ipv6_rip,
+       clear_ipv6_rip_cmd,
+       "clear ipv6 ripng [vrf WORD]",
+       CLEAR_STR
+       IPV6_STR
+       "Clear IPv6 RIP database\n"
+       VRF_CMD_HELP_STR)
+{
+       struct list *input;
+       int ret;
+
+       input = list_new();
+       if (vrf) {
+               struct yang_data *yang_vrf;
+
+               yang_vrf = yang_data_new(
+                       "/frr-ripngd:clear-ripng-route/input/vrf", vrf);
+               listnode_add(input, yang_vrf);
+       }
+
+       ret = nb_cli_rpc(vty, "/frr-ripngd:clear-ripng-route", input, NULL);
+
+       list_delete(&input);
+
+       return ret;
+}
+
 /* Update ECMP routes to zebra when ECMP is disabled. */
 void ripng_ecmp_disable(struct ripng *ripng)
 {
@@ -2648,6 +2680,7 @@ void ripng_init(void)
        /* Install ripng commands. */
        install_element(VIEW_NODE, &show_ipv6_ripng_cmd);
        install_element(VIEW_NODE, &show_ipv6_ripng_status_cmd);
+       install_element(ENABLE_NODE, &clear_ipv6_rip_cmd);
 
        ripng_if_init();
        ripng_debug_init();
index 83e376b55530ca7b5968dedd2427264919f64f30..a88114432df01bc374c0ed147084415a89df59a4 100644 (file)
@@ -27,6 +27,7 @@ ripngd_ripngd_SOURCES = \
 
 clippy_scan += \
        ripngd/ripng_cli.c \
+       ripngd/ripngd.c \
        # end
 
 noinst_HEADERS += \