diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-19 02:01:40 +0100 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-19 02:47:19 +0100 |
commit | 733462a991ffa70a4b4bf04282833956a8925b43 (patch) | |
tree | 2934faea9453847a06719deccd96c8749a8908d3 /zebra | |
parent | zebra: fix link-params admin-grp config output (diff) | |
download | frr-733462a991ffa70a4b4bf04282833956a8925b43.tar.xz frr-733462a991ffa70a4b4bf04282833956a8925b43.zip |
zebra: remove unnecessary checks from CLI
First, any data tree validation in CLI handler is not correct, because
this code won't be called when the change is done through any other
frontend. Second, these checks are not necessary at all, because NB
layer handles the change between admin-grp/affinity automatically.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/interface.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index cf25fe013..cbc0eb690 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -4256,23 +4256,10 @@ DEFPY_YANG(link_params_admin_grp, link_params_admin_grp_cmd, "Administrative group membership\n" "32-bit Hexadecimal value (e.g. 0xa1)\n") { - char xpath[XPATH_MAXLEN]; int idx_bitpattern = 1; unsigned long value; char value_str[11]; - VTY_DECLVAR_CONTEXT(interface, ifp); - - snprintf( - xpath, sizeof(xpath), - "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/affinities", - ifp->name); - if (yang_dnode_exists(running_config->dnode, xpath)) { - vty_out(vty, - "cannot use the admin-grp command when affinity is set\n"); - return CMD_WARNING_CONFIG_FAILED; - } - if (sscanf(argv[idx_bitpattern]->arg, "0x%lx", &value) != 1) { vty_out(vty, "link_params_admin_grp: fscanf: %s\n", safe_strerror(errno)); @@ -4738,19 +4725,6 @@ DEFPY_YANG(link_params_affinity, link_params_affinity_cmd, "Interface affinities\n" "Affinity names\n") { - VTY_DECLVAR_CONTEXT(interface, ifp); - char xpath[XPATH_MAXLEN]; - - snprintf( - xpath, sizeof(xpath), - "/frr-interface:lib/interface[name='%s']/frr-zebra:zebra/link-params/legacy-admin-group", - ifp->name); - if (yang_dnode_exists(running_config->dnode, xpath)) { - vty_out(vty, - "cannot use the affinity command when admin-grp is set\n"); - return CMD_WARNING_CONFIG_FAILED; - } - return ag_change(vty, argc, argv, "./frr-zebra:zebra/link-params/affinities/affinity", no, no ? 2 : 1); |