]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: handle ecom redirect-ip
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 6 Apr 2018 11:16:01 +0000 (13:16 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 9 Apr 2018 09:04:14 +0000 (11:04 +0200)
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>
bgpd/bgp_ecommunity.c
bgpd/bgp_ecommunity.h

index 54ec7d392b341d7a35e62c7924a8c54870666d46..80166dd32bed22410d7f304c4c89340bf6ce14a8 100644 (file)
@@ -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
index 31ff1481ba1feda89c3c5c82d760829aa7910e9b..0c22c5a149c6aa9f7368c8083704e7fd3643ba15 100644 (file)
@@ -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