From 32c0a2dd2cfab840ed7663d500b9bc4457ed93ce Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Mon, 31 Jan 2022 14:16:07 +0800 Subject: [PATCH] staticd: small cleanup Two small cleanups, just remove duplication. Signed-off-by: anlan_cs --- staticd/static_routes.c | 11 +---------- staticd/static_vty.c | 2 -- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/staticd/static_routes.c b/staticd/static_routes.c index 1d52dd30e2..589d509a59 100644 --- a/staticd/static_routes.c +++ b/staticd/static_routes.c @@ -335,6 +335,7 @@ struct static_nexthop *static_add_nexthop(struct static_path *pn, break; case STATIC_IPV4_GATEWAY_IFNAME: case STATIC_IPV6_GATEWAY_IFNAME: + case STATIC_IFNAME: ifp = if_lookup_by_name(ifname, nh->nh_vrf_id); if (ifp && ifp->ifindex != IFINDEX_INTERNAL) nh->ifindex = ifp->ifindex; @@ -342,16 +343,6 @@ struct static_nexthop *static_add_nexthop(struct static_path *pn, zlog_warn( "Static Route using %s interface not installed because the interface does not exist in specified vrf", ifname); - - break; - case STATIC_IFNAME: - ifp = if_lookup_by_name(ifname, nh->nh_vrf_id); - if (ifp && ifp->ifindex != IFINDEX_INTERNAL) { - nh->ifindex = ifp->ifindex; - } else - zlog_warn( - "Static Route using %s interface not installed because the interface does not exist in specified vrf", - ifname); break; } diff --git a/staticd/static_vty.c b/staticd/static_vty.c index 95d1386a67..c0ace0e258 100644 --- a/staticd/static_vty.c +++ b/staticd/static_vty.c @@ -140,8 +140,6 @@ static int static_route_leak(struct vty *vty, const char *svrf, /* Administrative distance. */ if (distance_str) distance = atoi(distance_str); - else - distance = ZEBRA_STATIC_DISTANCE_DEFAULT; /* tag */ if (tag_str) -- 2.39.5