summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_pbr.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-10-14 18:02:22 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2020-08-21 13:37:08 +0200
commit1840384bae2a0ab4d79781bda300ce8f54313d3b (patch)
tree00193dca54f46cef2f634ae80383615a269c83fa /bgpd/bgp_pbr.c
parentlib: add family attribute for flowspec prefix structure (diff)
downloadfrr-1840384bae2a0ab4d79781bda300ce8f54313d3b.tar.xz
frr-1840384bae2a0ab4d79781bda300ce8f54313d3b.zip
bgpd: flowspec code support for ipv6
until now, the assumption was done in bgp flowspec code that the information contained was an ipv4 flowspec prefix. now that it is possible to handle ipv4 or ipv6 flowspec prefixes, that information is stored in prefix_flowspec attribute. Also, some unlocking is done in order to process ipv4 and ipv6 flowspec entries. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_pbr.c')
-rw-r--r--bgpd/bgp_pbr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c
index 7c3e8cd70..38b1ae4da 100644
--- a/bgpd/bgp_pbr.c
+++ b/bgpd/bgp_pbr.c
@@ -668,6 +668,7 @@ static int bgp_pbr_validate_policy_route(struct bgp_pbr_entry_main *api)
}
/* return -1 if build or validation failed */
+
int bgp_pbr_build_and_validate_entry(const struct prefix *p,
struct bgp_path_info *path,
struct bgp_pbr_entry_main *api)
@@ -679,13 +680,13 @@ int bgp_pbr_build_and_validate_entry(const struct prefix *p,
struct bgp_pbr_entry_action *api_action;
struct prefix *src = NULL, *dst = NULL;
int valid_prefix = 0;
- afi_t afi = AFI_IP;
struct bgp_pbr_entry_action *api_action_redirect_ip = NULL;
bool discard_action_found = false;
+ afi_t afi = family2afi(p->u.prefix_flowspec.family);
/* extract match from flowspec entries */
ret = bgp_flowspec_match_rules_fill((uint8_t *)p->u.prefix_flowspec.ptr,
- p->u.prefix_flowspec.prefixlen, api);
+ p->u.prefix_flowspec.prefixlen, api, afi);
if (ret < 0)
return -1;
/* extract actiosn from flowspec ecom list */
@@ -2598,8 +2599,6 @@ void bgp_pbr_update_entry(struct bgp *bgp, const struct prefix *p,
{
struct bgp_pbr_entry_main api;
- if (afi == AFI_IP6)
- return; /* IPv6 not supported */
if (safi != SAFI_FLOWSPEC)
return; /* not supported */
/* Make Zebra API structure. */