]> git.puffer.fish Git - mirror/frr.git/commitdiff
staticd: small cleanup 10446/head
authoranlan_cs <vic.lan@pica8.com>
Mon, 31 Jan 2022 06:16:07 +0000 (14:16 +0800)
committeranlan_cs <vic.lan@pica8.com>
Mon, 31 Jan 2022 10:44:17 +0000 (18:44 +0800)
Two small cleanups, just remove duplication.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
staticd/static_routes.c
staticd/static_vty.c

index 1d52dd30e24651a3aab642149292dc89186886d8..589d509a59989d0ca1a1fddf4e4284e2f9d38668 100644 (file)
@@ -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;
        }
 
index 95d1386a674f4a0e9f3aa977c6b99dae3b0f4a1c..c0ace0e2588ca9d1f65c8595ea6585ba4685357a 100644 (file)
@@ -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)