]> git.puffer.fish Git - matthieu/frr.git/commitdiff
eigrpd: fix dependency on operational state in cli
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 12 Mar 2021 23:09:34 +0000 (02:09 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 24 Mar 2021 15:55:56 +0000 (18:55 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
eigrpd/eigrp_cli.c

index 3e667aa6b720a7c9e4a26c3df8dd8e4fc6b470e8..0b4774ba426cfd1d90f643955b92686dcddef233 100644 (file)
@@ -702,12 +702,12 @@ DEFPY_YANG(
 void eigrp_cli_show_summarize_address(struct vty *vty, struct lyd_node *dnode,
                                      bool show_defaults)
 {
-       const struct eigrp_interface *eif = nb_running_get_entry(dnode, NULL,
-                                                                true);
+       const struct lyd_node *instance = yang_dnode_get_parent(dnode, "instance");
+       uint16_t asn = yang_dnode_get_uint16(instance, "./asn");
        const char *summarize_address = yang_dnode_get_string(dnode, NULL);
 
-       vty_out(vty, " ip summary-address eigrp %d %s\n",
-               eif->eigrp->AS, summarize_address);
+       vty_out(vty, " ip summary-address eigrp %d %s\n", asn,
+               summarize_address);
 }
 
 /*
@@ -766,12 +766,11 @@ DEFPY_YANG(
 void eigrp_cli_show_authentication(struct vty *vty, struct lyd_node *dnode,
                                   bool show_defaults)
 {
-       const struct eigrp_interface *eif = nb_running_get_entry(dnode, NULL,
-                                                                true);
+       const struct lyd_node *instance = yang_dnode_get_parent(dnode, "instance");
+       uint16_t asn = yang_dnode_get_uint16(instance, "./asn");
        const char *crypt = yang_dnode_get_string(dnode, NULL);
 
-       vty_out(vty, " ip authentication mode eigrp %d %s\n",
-               eif->eigrp->AS, crypt);
+       vty_out(vty, " ip authentication mode eigrp %d %s\n", asn, crypt);
 }
 
 /*
@@ -826,12 +825,12 @@ DEFPY_YANG(
 void eigrp_cli_show_keychain(struct vty *vty, struct lyd_node *dnode,
                             bool show_defaults)
 {
-       const struct eigrp_interface *eif = nb_running_get_entry(dnode, NULL,
-                                                                true);
+       const struct lyd_node *instance = yang_dnode_get_parent(dnode, "instance");
+       uint16_t asn = yang_dnode_get_uint16(instance, "./asn");
        const char *keychain = yang_dnode_get_string(dnode, NULL);
 
-       vty_out(vty, " ip authentication key-chain eigrp %d %s\n",
-               eif->eigrp->AS, keychain);
+       vty_out(vty, " ip authentication key-chain eigrp %d %s\n", asn,
+               keychain);
 }