summaryrefslogtreecommitdiff
path: root/staticd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-31 14:10:09 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-02-02 00:25:15 +0200
commit5dfa36b6a7bf52041e61ea3bdcf8fd7c92fc61af (patch)
treeb9f0fe2a202e118e47f52d9020864654a5521212 /staticd
parentd205208f57855a219e9c72b8a24976af3eb34bcd (diff)
staticd: fix nexthops without interface
When interface is not set in "ip route" command, CLI passes "(null)" as an interface name instead of an empty string. The actual code in turn uses "nh->ifname[0] != 0" to check if the interface name was set. Fix the problem by changing the "(null)" string into an empty string when populating the nexthop structure. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_nb_config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c
index 78378371b0..d7605cb347 100644
--- a/staticd/static_nb_config.c
+++ b/staticd/static_nb_config.c
@@ -176,6 +176,9 @@ static bool static_nexthop_create(struct nb_cb_create_args *args)
nh_vrf = yang_dnode_get_string(args->dnode, "vrf");
pn = nb_running_get_entry(args->dnode, NULL, true);
+ if (strmatch(ifname, "(null)"))
+ ifname = "";
+
if (!static_add_nexthop_validate(nh_vrf, nh_type, &ipaddr))
flog_warn(
EC_LIB_NB_CB_CONFIG_VALIDATE,