diff options
author | Maria Matejka <mq@ucw.cz> | 2022-06-07 12:18:23 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-06-07 12:18:25 +0200 |
commit | 8fd3811d9d29d73570e03147eb024a4e5fde199b (patch) | |
tree | 28e0b93138b1c9c5832b377355d2de21cc73b814 /proto/bgp/attrs.c | |
parent | ea109ce3e3474dd10d7592c44d2371b794f5c867 (diff) |
Fixing FlowSpec validation for v3 internal API
Validation is called internally from route table at the same place where
nexthop resolution is done. Also accounting for rte->sender semantics
change (not a channel but the import hook instead).
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r-- | proto/bgp/attrs.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 11b1c728..ccfda4df 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -2390,25 +2390,28 @@ bgp_get_route_info(rte *e, byte *buf) buf += bsprintf(buf, " (%d", rt_get_preference(e)); - if (e->pflags & BGP_REF_SUPPRESSED) - buf += bsprintf(buf, "-"); + if (!net_is_flow(e->net)) + { + if (e->pflags & BGP_REF_SUPPRESSED) + buf += bsprintf(buf, "-"); - if (rte_stale(e)) - buf += bsprintf(buf, "s"); + if (rte_stale(e)) + buf += bsprintf(buf, "s"); - u64 metric = bgp_total_aigp_metric(e); - if (metric < BGP_AIGP_MAX) - { - buf += bsprintf(buf, "/%lu", metric); - } - else if (metric = rt_get_igp_metric(e)) - { - if (!rta_resolvable(e->attrs)) - buf += bsprintf(buf, "/-"); - else if (metric >= IGP_METRIC_UNKNOWN) - buf += bsprintf(buf, "/?"); - else - buf += bsprintf(buf, "/%d", metric); + u64 metric = bgp_total_aigp_metric(e); + if (metric < BGP_AIGP_MAX) + { + buf += bsprintf(buf, "/%lu", metric); + } + else if (metric = rt_get_igp_metric(e)) + { + if (!rta_resolvable(e->attrs)) + buf += bsprintf(buf, "/-"); + else if (metric >= IGP_METRIC_UNKNOWN) + buf += bsprintf(buf, "/?"); + else + buf += bsprintf(buf, "/%d", metric); + } } buf += bsprintf(buf, ") ["); |