diff options
| author | anlan_cs <vic.lan@pica8.com> | 2022-01-31 14:16:07 +0800 |
|---|---|---|
| committer | anlan_cs <vic.lan@pica8.com> | 2022-01-31 18:44:17 +0800 |
| commit | 32c0a2dd2cfab840ed7663d500b9bc4457ed93ce (patch) | |
| tree | b53e9d497731f4dd15b0f04a2e9afc2ed2c63c4f | |
| parent | 9e84443acac051c31e504d8da657c2776332edf5 (diff) | |
staticd: small cleanup
Two small cleanups, just remove duplication.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
| -rw-r--r-- | staticd/static_routes.c | 11 | ||||
| -rw-r--r-- | staticd/static_vty.c | 2 |
2 files changed, 1 insertions, 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) |
