]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: move and rename the infinity metric constants
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 14 Nov 2020 02:28:07 +0000 (23:28 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 24 Nov 2020 23:15:51 +0000 (20:15 -0300)
Those constants are also useful in contexts other than LDP-IGP
Synchronization (e.g. the upcoming LFA work will need them). Move
them to a more general header to reflect that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
isisd/isis_ldp_sync.c
isisd/isis_ldp_sync.h
isisd/isis_tlvs.h

index 988af64c488d779c276b0486a99f17a545215b00..3b1faffe53304af78026f7512ed3bded9b1faf3d 100644 (file)
@@ -429,20 +429,24 @@ void isis_ldp_sync_set_if_metric(struct isis_circuit *circuit, bool run_regen)
                        if (circuit->area->newmetric) {
                                ldp_sync_info->metric[0] =
                                        circuit->te_metric[0];
-                               circuit->te_metric[0] = LDP_ISIS_LSINFINITY;
+                               circuit->te_metric[0] =
+                                       ISIS_WIDE_METRIC_INFINITY;
                        } else {
                                ldp_sync_info->metric[0] = circuit->metric[0];
-                               circuit->metric[0] = LDP_ISIS_LSINFINITY_NL;
+                               circuit->metric[0] =
+                                       ISIS_NARROW_METRIC_INFINITY;
                        }
                }
                if (circuit->is_type & IS_LEVEL_2) {
                        if (circuit->area->newmetric) {
                                ldp_sync_info->metric[1] =
                                        circuit->te_metric[1];
-                               circuit->te_metric[1] = LDP_ISIS_LSINFINITY;
+                               circuit->te_metric[1] =
+                                       ISIS_WIDE_METRIC_INFINITY;
                        } else {
                                ldp_sync_info->metric[1] = circuit->metric[1];
-                               circuit->metric[1] = LDP_ISIS_LSINFINITY_NL;
+                               circuit->metric[1] =
+                                       ISIS_NARROW_METRIC_INFINITY;
                        }
                }
        } else {
index 6017cdf001863cc501fea66c5e682a2f738aa17f..61ac946078db0fe54c2628ae38eb2825cd4c24d8 100644 (file)
@@ -20,9 +20,6 @@
 #ifndef _ZEBRA_ISIS_LDP_SYNC_H
 #define _ZEBRA_ISIS_LDP_SYNC_H
 
-#define LDP_ISIS_LSINFINITY 0xFFFFFE  /* wide link metric */
-#define LDP_ISIS_LSINFINITY_NL 62     /* narrow link metric */
-
 /* Macro to log debug message */
 #define ils_debug(...)                                                         \
        do {                                                                   \
index 54ded8121d740a9c0b6b498bb421c8791d7a1f50..037f91f0b87340e6cffc0d45432b886d887634ae 100644 (file)
@@ -42,6 +42,9 @@ struct isis_area_address {
        uint8_t len;
 };
 
+#define ISIS_WIDE_METRIC_INFINITY   0xFFFFFE
+#define ISIS_NARROW_METRIC_INFINITY 62
+
 struct isis_oldstyle_reach;
 struct isis_oldstyle_reach {
        struct isis_oldstyle_reach *next;