From b72220fccda0fb96043e4b91b4afdacfb63e5a78 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 6 Apr 2018 13:16:01 +0200 Subject: 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 --- bgpd/bgp_ecommunity.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bgpd/bgp_ecommunity.c') 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 -- cgit v1.2.3