diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-09-01 19:43:24 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-09-05 16:50:34 +0200 |
commit | 9aabb2ea7421e1bcdd010f474d9b74d8f447b3bb (patch) | |
tree | 62c91f640379c39a335c22fbec19eeceb66d45e3 /zebra/zebra_vty.c | |
parent | Merge pull request #1102 from donaldsharp/eigrp_compile (diff) | |
download | frr-9aabb2ea7421e1bcdd010f474d9b74d8f447b3bb.tar.xz frr-9aabb2ea7421e1bcdd010f474d9b74d8f447b3bb.zip |
zebra: display static blackhole routes consistently
If we configure a static route pointing to null0 and zebra displays
it with the 'blackhole' keyword in the running configuration, the
frr-reload.py script will have issues. Fix this by introducing the
'static_blackhole_type' enum.
Fixes #1091.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r-- | zebra/zebra_vty.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 95ba19b1f..3141782c5 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -74,7 +74,7 @@ static int zebra_static_route(struct vty *vty, afi_t afi, safi_t safi, union g_addr gate; union g_addr *gatep = NULL; struct in_addr mask; - enum blackhole_type bh_type = 0; + enum static_blackhole_type bh_type = 0; route_tag_t tag = 0; struct zebra_vrf *zvrf; u_char type; @@ -169,14 +169,13 @@ static int zebra_static_route(struct vty *vty, afi_t afi, safi_t safi, if (flag_str) { switch (flag_str[0]) { case 'r': - case 'R': /* XXX */ - bh_type = BLACKHOLE_REJECT; + bh_type = STATIC_BLACKHOLE_REJECT; break; case 'n': - case 'N' /* XXX */: + bh_type = STATIC_BLACKHOLE_NULL; + break; case 'b': - case 'B': /* XXX */ - bh_type = BLACKHOLE_NULL; + bh_type = STATIC_BLACKHOLE_DROP; break; default: vty_out(vty, "%% Malformed flag %s \n", flag_str); @@ -1712,12 +1711,15 @@ static int static_config(struct vty *vty, afi_t afi, safi_t safi, break; case STATIC_BLACKHOLE: switch (si->bh_type) { - case BLACKHOLE_REJECT: - vty_out(vty, " reject"); - break; - default: + case STATIC_BLACKHOLE_DROP: vty_out(vty, " blackhole"); break; + case STATIC_BLACKHOLE_NULL: + vty_out(vty, " null0"); + break; + case STATIC_BLACKHOLE_REJECT: + vty_out(vty, " reject"); + break; } break; case STATIC_IPV4_GATEWAY_IFNAME: |