summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_flowspec_vty.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-10-17 16:08:16 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2020-08-21 13:37:08 +0200
commit9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081 (patch)
tree45cfd8f558a4408c32b4ce4bd7407391b92e930f /bgpd/bgp_flowspec_vty.c
parentbgp, zebra: add family attribute to ipset and iptable context (diff)
downloadfrr-9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081.tar.xz
frr-9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081.zip
bgpd: support for bgp ipv6 ext community, and flowspec redirect ipv6
rfc 5701 is supported. it is possible to configure in bgp vpn, a list of route target with ipv6 external communities to import. it is to be noted that this ipv6 external community has been developed only for matching a bgp flowspec update with same ipv6 ext commmunity. adding to this, draft-ietf-idr-flow-spec-v6-09 is implemented regarding the redirect ipv6 option. Practically, under bgp vpn, under ipv6 unicast, it is possible to configure : [no] rt6 redirect import <IPV6>:<AS> values. An incoming bgp update with fs ipv6 and that option matching a bgp vrf, will be imported in that bgp vrf. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_flowspec_vty.c')
-rw-r--r--bgpd/bgp_flowspec_vty.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/bgpd/bgp_flowspec_vty.c b/bgpd/bgp_flowspec_vty.c
index 3e3366bf8..b4bec75f0 100644
--- a/bgpd/bgp_flowspec_vty.c
+++ b/bgpd/bgp_flowspec_vty.c
@@ -263,7 +263,7 @@ void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
{
struct attr *attr;
char return_string[BGP_FLOWSPEC_STRING_DISPLAY_MAX];
- char *s;
+ char *s = NULL, *s2 = NULL;
json_object *json_nlri_path = NULL;
json_object *json_ecom_path = NULL;
json_object *json_time_path = NULL;
@@ -306,21 +306,31 @@ void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
}
if (!path)
return;
- if (path->attr->ecommunity) {
+ if (path->attr &&
+ (path->attr->ecommunity || path->attr->ipv6_ecommunity)) {
/* Print attribute */
attr = path->attr;
- s = ecommunity_ecom2str(attr->ecommunity,
- ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
- if (!s)
+ if (attr->ecommunity)
+ s = ecommunity_ecom2str(attr->ecommunity,
+ ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
+ if (attr->ipv6_ecommunity)
+ s2 = ecommunity_ecom2str(attr->ipv6_ecommunity,
+ ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
+ if (!s && !s2)
return;
if (display == NLRI_STRING_FORMAT_LARGE)
- vty_out(vty, "\t%s\n", s);
+ vty_out(vty, "\t%s%s%s\n", s ? s : "",
+ s2 && s ? " " : "", s2 ? s2 : "");
else if (display == NLRI_STRING_FORMAT_MIN)
- vty_out(vty, "%s", s);
+ vty_out(vty, "%s%s", s ? s : "", s2 ? s2 : "");
else if (json_paths) {
json_ecom_path = json_object_new_object();
- json_object_string_add(json_ecom_path,
- "ecomlist", s);
+ if (s)
+ json_object_string_add(json_ecom_path,
+ "ecomlist", s);
+ if (s2)
+ json_object_string_add(json_ecom_path,
+ "ecom6list", s2);
if (display == NLRI_STRING_FORMAT_JSON)
json_object_array_add(json_paths,
json_ecom_path);