summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-06-08 11:47:49 +0200
committerMaria Matejka <mq@ucw.cz>2022-06-08 11:47:49 +0200
commitcae5979871ee7aa341334f8b1af6bafc60ee9692 (patch)
tree490f68c9c5d856ab560f2194fe350cd68039cccd /proto/bgp/attrs.c
parent8fd3811d9d29d73570e03147eb024a4e5fde199b (diff)
parent950775f6fa3d569a9d7cd05e33538d35e895d688 (diff)
Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesund
There were quite a lot of conflicts in flowspec validation code which ultimately led to some code being a bit rewritten, not only adapted from this or that branch, yet it is still in a limit of a merge.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index ccfda4df..0b715eaa 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -1715,8 +1715,20 @@ bgp_preexport(struct channel *c, rte *e)
return 0;
/* Reject flowspec that failed validation */
- if ((e->attrs->dest == RTD_UNREACHABLE) && net_is_flow(e->net))
- return -1;
+ if (net_is_flow(e->net))
+ switch (rt_get_flowspec_valid(e))
+ {
+ case FLOWSPEC_VALID:
+ break;
+ case FLOWSPEC_INVALID:
+ return -1;
+ case FLOWSPEC_UNKNOWN:
+ ASSUME((rt_get_source_attr(e) != RTS_BGP) ||
+ !((struct bgp_channel *) SKIP_BACK(struct channel, in_req, e->sender->req))->base_table);
+ break;
+ case FLOWSPEC__MAX:
+ bug("This never happens.");
+ }
/* IBGP route reflection, RFC 4456 */
if (p->is_internal && src->is_internal && (p->local_as == src->local_as))