]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: fix SID/Label Sub TLV size 8690/head
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 18 May 2021 15:25:14 +0000 (18:25 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 18 May 2021 18:00:41 +0000 (21:00 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
ospfd/ospf_ri.c
ospfd/ospf_sr.h

index 4083ea9332a206e2a1919ca84e0854af7d94d2e3..988bcd67c6e604e6dc5ed31126962c4ed6c8c9b6 100644 (file)
@@ -447,8 +447,7 @@ static void set_sr_global_label_range(struct sr_block srgb)
 {
        /* Set Header */
        TLV_TYPE(OspfRI.sr_info.srgb) = htons(RI_SR_TLV_SRGB_LABEL_RANGE);
-       TLV_LEN(OspfRI.sr_info.srgb) =
-               htons(SUBTLV_SID_LABEL_SIZE + sizeof(uint32_t));
+       TLV_LEN(OspfRI.sr_info.srgb) = htons(RI_SR_TLV_LABEL_RANGE_SIZE);
        /* Set Range Size */
        OspfRI.sr_info.srgb.size = htonl(SET_RANGE_SIZE(srgb.range_size));
        /* Set Lower bound label SubTLV */
@@ -471,8 +470,7 @@ static void set_sr_local_label_range(struct sr_block srlb)
 {
        /* Set Header */
        TLV_TYPE(OspfRI.sr_info.srlb) = htons(RI_SR_TLV_SRLB_LABEL_RANGE);
-       TLV_LEN(OspfRI.sr_info.srlb) =
-               htons(SUBTLV_SID_LABEL_SIZE + sizeof(uint32_t));
+       TLV_LEN(OspfRI.sr_info.srlb) = htons(RI_SR_TLV_LABEL_RANGE_SIZE);
        /* Set Range Size */
        OspfRI.sr_info.srlb.size = htonl(SET_RANGE_SIZE(srlb.range_size));
        /* Set Lower bound label SubTLV */
index ce13457484080071daaa0e8ef8f3e28a5b775920..f00d8e1b0bf9d27d997aaf283b970af29d348f0b 100644 (file)
@@ -61,7 +61,7 @@
 
 /* SID/Label Sub TLV - section 2.1 */
 #define SUBTLV_SID_LABEL               1
-#define SUBTLV_SID_LABEL_SIZE          8
+#define SUBTLV_SID_LABEL_SIZE          4
 struct subtlv_sid_label {
        /* Length is 3 (20 rightmost bits MPLS label) or 4 (32 bits SID) */
        struct tlv_header header;
@@ -88,6 +88,7 @@ struct ri_sr_tlv_sr_algorithm {
 /* RI SID/Label Range TLV used for SRGB & SRLB - section 3.2 & 3.3 */
 #define RI_SR_TLV_SRGB_LABEL_RANGE     9
 #define RI_SR_TLV_SRLB_LABEL_RANGE     14
+#define RI_SR_TLV_LABEL_RANGE_SIZE     12
 struct ri_sr_tlv_sid_label_range {
        struct tlv_header header;
 /* Only 24 upper most bits are significant */