]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix display with flowspec tcp flags option
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 12 Jun 2018 16:26:35 +0000 (18:26 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 28 Jun 2018 06:52:15 +0000 (08:52 +0200)
When displaying RIB FS summary, the TCP option is not displayed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_flowspec_util.c
bgpd/bgp_flowspec_vty.c

index 956cf28c211dfc2df74f0a0bada96ccaac4acad3..db85c642aacb8827e9e6f0f45cbc798f9ff5d5cb 100644 (file)
@@ -348,32 +348,33 @@ int bgp_flowspec_tcpflags_decode(enum bgp_flowspec_util_nlri_t type,
                case BGP_FLOWSPEC_RETURN_STRING:
                        if (op[1] == 1 && loop != 0) {
                                len_written = snprintf(ptr, len_string,
-                                                      ", and ");
+                                                      ",&");
                                len_string -= len_written;
                                ptr += len_written;
                        } else if (op[1] == 0 && loop != 0) {
                                len_written = snprintf(ptr, len_string,
-                                                     ", or ");
+                                                     ",|");
                                len_string -= len_written;
                                ptr += len_written;
                        }
-                       len_written = snprintf(ptr, len_string,
-                                              "tcp flags is ");
-                       len_string -= len_written;
-                       ptr += len_written;
-                       if (op[6] == 1) {
-                               ptr += snprintf(ptr, len_string,
-                                              "not ");
+                       if (op[7] == 1) {
+                               len_written = snprintf(ptr, len_string,
+                                              "= ");
+                               len_string -= len_written;
+                               ptr += len_written;
+                       } else {
+                               len_written = snprintf(ptr, len_string,
+                                                      "∋ ");
                                len_string -= len_written;
                                ptr += len_written;
                        }
-                       if (op[7] == 1) {
-                               ptr += snprintf(ptr, len_string,
-                                              "exactly match ");
+                       if (op[6] == 1) {
+                               len_written = snprintf(ptr, len_string,
+                                              "! ");
                                len_string -= len_written;
                                ptr += len_written;
                        }
-                       ptr += snprintf(ptr, len_string,
+                       len_written = snprintf(ptr, len_string,
                                       "%d", value);
                        len_string -= len_written;
                        ptr += len_written;
index b21e5ae0dcc4b2284c510c91dee3af34868d0d1c..6b0390ed0fb3d5d5d8538a440beae8a8f6764bec 100644 (file)
@@ -62,7 +62,7 @@ static const struct message bgp_flowspec_display_min[] = {
        {FLOWSPEC_SRC_PORT, "srcp"},
        {FLOWSPEC_ICMP_TYPE, "type"},
        {FLOWSPEC_ICMP_CODE, "code"},
-       {FLOWSPEC_TCP_FLAGS, "flags"},
+       {FLOWSPEC_TCP_FLAGS, "tcp"},
        {FLOWSPEC_PKT_LEN, "pktlen"},
        {FLOWSPEC_DSCP, "dscp"},
        {FLOWSPEC_FRAGMENT, "pktfrag"},