]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12730 from louis-6wind/fix-ext-te-metrics
authorOlivier Dugeon <olivier.dugeon@orange.com>
Thu, 9 Feb 2023 14:12:41 +0000 (15:12 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Feb 2023 14:12:41 +0000 (15:12 +0100)
Fix for Extended TE metrics

isisd/isis_te.c
isisd/isis_tlvs.c
isisd/isis_tlvs.h
lib/if.h

index ed915c4561d154e79541e119252e98441fee0d1e..993d894f22cb9e4a837760be9dae4a3c92e395ce 100644 (file)
@@ -1541,7 +1541,7 @@ static void show_ext_sub(struct vty *vty, char *name,
                sbuf_push(&buf, 4,
                          "%s Average Link Delay: %u (micro-sec)\n",
                          IS_ANORMAL(ext->delay) ? "Anomalous" : "Normal",
-                         ext->delay);
+                         ext->delay & TE_EXT_MASK);
        if (IS_SUBTLV(ext, EXT_MM_DELAY)) {
                sbuf_push(&buf, 4, "%s Min/Max Link Delay: %u / %u (micro-sec)\n",
                          IS_ANORMAL(ext->min_delay) ? "Anomalous" : "Normal",
index 8907fa256b288b7a3686e64a9090913dede978ce..ae0a208d21d37acaeed8f10ddb1da98f0be8b9dc 100644 (file)
@@ -401,7 +401,7 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
                                  "%s Average Link Delay: %u (micro-sec)\n",
                                  IS_ANORMAL(exts->delay) ? "Anomalous"
                                                          : "Normal",
-                                 exts->delay);
+                                 exts->delay & TE_EXT_MASK);
        }
        if (IS_SUBTLV(exts, EXT_MM_DELAY)) {
                if (json) {
index 905032bda1aff3912d97b66067df0b69973231de..52dfb7a84facd426a3a883eee8b210bd41621800 100644 (file)
@@ -484,7 +484,7 @@ enum ext_subtlv_size {
  * For Delay and packet Loss, upper bit (A) indicates if the value is
  * normal (0) or anomalous (1).
  */
-#define IS_ANORMAL(v) (v & 0x80000000)
+#define IS_ANORMAL(v) (v & TE_EXT_ANORMAL)
 
 struct isis_ext_subtlvs {
 
index a653246ccb2ee61d1df3202c6eb5e2e40061ce76..acd60e9d062faad00d6a78099189df25078591cc 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -140,7 +140,7 @@ struct if_stats {
 #endif /* HAVE_PROC_NET_DEV */
 
 /* Here are "non-official" architectural constants. */
-#define TE_EXT_MASK             0x0FFFFFFF
+#define TE_EXT_MASK             0x00FFFFFF
 #define TE_EXT_ANORMAL          0x80000000
 #define LOSS_PRECISION          0.000003
 /* TE_MEGA_BIT and TE_BYTE are utilized to convert TE bandwidth */