diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-06 13:16:01 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-09 11:04:14 +0200 |
commit | b72220fccda0fb96043e4b91b4afdacfb63e5a78 (patch) | |
tree | 947d057a854f2f14cb05993deb0ef455c925e271 /bgpd | |
parent | Merge pull request #2037 from coreswitch/master (diff) | |
download | frr-b72220fccda0fb96043e4b91b4afdacfb63e5a78.tar.xz frr-b72220fccda0fb96043e4b91b4afdacfb63e5a78.zip |
bgpd: handle ecom redirect-ip
This extended ecommunity is defined with
draft-ietf-idr-flowspec-redirect-ip-02 and is read from the BGP update
received.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_ecommunity.c | 12 | ||||
-rw-r--r-- | bgpd/bgp_ecommunity.h | 1 |
2 files changed, 9 insertions, 4 deletions
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 54ec7d392..80166dd32 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -736,6 +736,14 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter) "MM:%u", seqnum); } else unk_ecom = 1; + } else if (type == ECOMMUNITY_ENCODE_REDIRECT_IP_NH) { + sub_type = *pnt++; + if (sub_type == ECOMMUNITY_REDIRECT_IP_NH) { + len = sprintf( + str_buf + str_pnt, + "FS:redirect IP 0x%x", *(pnt+5)); + } else + unk_ecom = 1; } else if (type == ECOMMUNITY_ENCODE_TRANS_EXP) { sub_type = *pnt++; @@ -785,10 +793,6 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter) len = sprintf( str_buf + str_pnt, "FS:marking %u", *(pnt+5)); - } else if (sub_type == ECOMMUNITY_REDIRECT_IP_NH) { - len = sprintf( - str_buf + str_pnt, - "FS:redirect IP 0x%x", *(pnt+5)); } else unk_ecom = 1; } else diff --git a/bgpd/bgp_ecommunity.h b/bgpd/bgp_ecommunity.h index 31ff1481b..0c22c5a14 100644 --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@ -28,6 +28,7 @@ #define ECOMMUNITY_ENCODE_OPAQUE 0x03 #define ECOMMUNITY_ENCODE_EVPN 0x06 #define ECOMMUNITY_ENCODE_TRANS_EXP 0x80 /* Flow Spec */ +#define ECOMMUNITY_ENCODE_REDIRECT_IP_NH 0x08 /* Flow Spec */ /* RFC7674 */ #define ECOMMUNITY_EXTENDED_COMMUNITY_PART_2 0x81 #define ECOMMUNITY_EXTENDED_COMMUNITY_PART_3 0x82 |