diff options
| author | Daniel Walton <dwalton76@gmail.com> | 2017-09-05 12:54:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-05 12:54:05 -0400 |
| commit | 41bcc4a91e5f68f3cf9c01b63f9d9281ebdfa654 (patch) | |
| tree | fa38862d2e014806b278b7d5cb8a8b4449fccdfa /zebra/zebra_static.c | |
| parent | 75048747e9f4e27a1669c2f7dbb1b73d63e7ab5c (diff) | |
| parent | 57a58d777f65d8fec9efe52c3e69c9341694eb69 (diff) | |
Merge pull request #1093 from opensourcerouting/static_blackhole_display
zebra: display static blackhole routes consistently
Diffstat (limited to 'zebra/zebra_static.c')
| -rw-r--r-- | zebra/zebra_static.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c index ec6d406325..658f060fff 100644 --- a/zebra/zebra_static.c +++ b/zebra/zebra_static.c @@ -45,6 +45,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p, struct route_table *table; struct prefix nh_p; struct nexthop *nexthop = NULL; + enum blackhole_type bh_type = 0; /* Lookup table. */ table = zebra_vrf_table(afi, safi, si->vrf_id); @@ -52,6 +53,17 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p, return; memset(&nh_p, 0, sizeof(nh_p)); + if (si->type == STATIC_BLACKHOLE) { + switch (si->bh_type) { + case STATIC_BLACKHOLE_DROP: + case STATIC_BLACKHOLE_NULL: + bh_type = BLACKHOLE_NULL; + break; + case STATIC_BLACKHOLE_REJECT: + bh_type = BLACKHOLE_REJECT; + break; + } + } /* Lookup existing route */ rn = srcdest_rnode_get(table, p, src_p); @@ -92,7 +104,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p, break; case STATIC_BLACKHOLE: nexthop = route_entry_nexthop_blackhole_add( - re, si->bh_type); + re, bh_type); break; case STATIC_IPV6_GATEWAY: nexthop = route_entry_nexthop_ipv6_add(re, @@ -168,7 +180,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p, break; case STATIC_BLACKHOLE: nexthop = route_entry_nexthop_blackhole_add( - re, si->bh_type); + re, bh_type); break; case STATIC_IPV6_GATEWAY: nexthop = route_entry_nexthop_ipv6_add(re, @@ -363,7 +375,7 @@ void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p, int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p, struct prefix_ipv6 *src_p, union g_addr *gate, - const char *ifname, enum blackhole_type bh_type, + const char *ifname, enum static_blackhole_type bh_type, route_tag_t tag, u_char distance, struct zebra_vrf *zvrf, struct static_nh_label *snh_label) { |
