diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-08-09 20:42:27 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-09 20:42:27 +0200 |
| commit | 4e1fd26a5ef5adb25d53c2acbd9dbe8d18652ef5 (patch) | |
| tree | c3cffc3302835c7a9ee2ef5388579b5a8d473ee3 /zebra/zebra_vty.c | |
| parent | 5d13cd091a183601eb8ebedeeeed2121ce4c3781 (diff) | |
| parent | fc73dd4bdf96cbab00e7d5de67ec56503c6d9783 (diff) | |
Merge remote-tracking branch 'frr/master' into tcp-zebra
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 13c4429d6a..e260338131 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -55,9 +55,6 @@ static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi, static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn, int mcast); -#define ONE_DAY_SECOND 60*60*24 -#define ONE_WEEK_SECOND 60*60*24*7 - /* VNI range as per RFC 7432 */ #define CMD_VNI_RANGE "(1-16777215)" @@ -80,7 +77,6 @@ static int zebra_static_route(struct vty *vty, afi_t afi, safi_t safi, u_char flag = 0; route_tag_t tag = 0; struct zebra_vrf *zvrf; - unsigned int ifindex = 0; u_char type; struct static_nh_label snh_label; @@ -207,26 +203,15 @@ static int zebra_static_route(struct vty *vty, afi_t afi, safi_t safi, gatep = &gate; } - if (ifname) { - struct interface *ifp; - ifp = if_lookup_by_name(ifname, zvrf_id(zvrf)); - if (!ifp) { - vty_out(vty, "%% Malformed Interface name %s\n", - ifname); - ifindex = IFINDEX_DELETED; - } else - ifindex = ifp->ifindex; - } - if (gate_str == NULL && ifname == NULL) type = STATIC_BLACKHOLE; else if (gate_str && ifname) { if (afi == AFI_IP) - type = STATIC_IPV4_GATEWAY_IFINDEX; + type = STATIC_IPV4_GATEWAY_IFNAME; else - type = STATIC_IPV6_GATEWAY_IFINDEX; + type = STATIC_IPV6_GATEWAY_IFNAME; } else if (ifname) - type = STATIC_IFINDEX; + type = STATIC_IFNAME; else { if (afi == AFI_IP) type = STATIC_IPV4_GATEWAY; @@ -235,10 +220,10 @@ static int zebra_static_route(struct vty *vty, afi_t afi, safi_t safi, } if (!negate) - static_add_route(afi, safi, type, &p, src_p, gatep, ifindex, - ifname, flag, tag, distance, zvrf, &snh_label); + static_add_route(afi, safi, type, &p, src_p, gatep, ifname, + flag, tag, distance, zvrf, &snh_label); else - static_delete_route(afi, safi, type, &p, src_p, gatep, ifindex, + static_delete_route(afi, safi, type, &p, src_p, gatep, ifname, tag, distance, zvrf, &snh_label); return CMD_SUCCESS; @@ -1705,7 +1690,7 @@ static int static_config(struct vty *vty, afi_t afi, safi_t safi, &si->addr.ipv6, buf, sizeof buf)); break; - case STATIC_IFINDEX: + case STATIC_IFNAME: vty_out(vty, " %s", si->ifname); break; /* blackhole and Null0 mean the same thing */ @@ -1715,7 +1700,7 @@ static int static_config(struct vty *vty, afi_t afi, safi_t safi, else vty_out(vty, " Null0"); break; - case STATIC_IPV4_GATEWAY_IFINDEX: + case STATIC_IPV4_GATEWAY_IFNAME: vty_out(vty, " %s %s", inet_ntop(AF_INET, &si->addr.ipv4, buf, @@ -1723,7 +1708,7 @@ static int static_config(struct vty *vty, afi_t afi, safi_t safi, ifindex2ifname(si->ifindex, si->vrf_id)); break; - case STATIC_IPV6_GATEWAY_IFINDEX: + case STATIC_IPV6_GATEWAY_IFNAME: vty_out(vty, " %s %s", inet_ntop(AF_INET6, &si->addr.ipv6, buf, |
