]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix printing link state ospf opaque data
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 28 Sep 2023 15:38:13 +0000 (17:38 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Thu, 28 Sep 2023 16:59:34 +0000 (18:59 +0200)
Fix printing link state ospf opaque data. pnt address was not moving
in the loop.

Fixes: 8b531b1107 ("bgpd: store and send bgp link-state attributes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd/bgp_linkstate_tlv.c

index f2bd36524d3fd4eb642f546d2235d8be07d68b97..3669d68b85044439c0a66645b1a734234be4fbb1 100644 (file)
@@ -1354,7 +1354,6 @@ static void bgp_linkstate_tlv_opaque_display(struct vty *vty, uint8_t *pnt,
        uint8_t *lim = pnt + length;
        bool ospf_tlv_header;
        char tlv_type[6];
-       int i;
 
 
        if (json) {
@@ -1400,21 +1399,15 @@ static void bgp_linkstate_tlv_opaque_display(struct vty *vty, uint8_t *pnt,
                        continue;
                }
 
-               vty_out(vty, "\n%*sTLV type %u: 0x", indent, "", sub_type);
+               vty_out(vty, "\n%*sTLV type %u: ", indent, "", sub_type);
 
                if (pnt + sub_length > lim) {
                        vty_out(vty, "Bad length received: %u\n", sub_length);
                        break;
                }
 
-               for (i = 0; i < sub_length; i++) {
-                       if (i != 0 && i % 8 == 0)
-                               vty_out(vty, " ");
-                       vty_out(vty, "%02x", *pnt);
-               }
+               bgp_linkstate_tlv_hexa_display(vty, pnt, sub_length, NULL);
        }
-       if (!json)
-               vty_out(vty, "\n");
 }
 
 static void bgp_linkstate_tlv_rtm_capability_display(struct vty *vty,