]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: fix change flex-algorithm number from uint32 to uint8
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 Oct 2024 08:23:54 +0000 (10:23 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 30 Oct 2024 08:44:08 +0000 (08:44 +0000)
The algorithm number is encoded on 8 bits and does not require
an unsigned 32 bit value to store the value.

Fixes: cc4926c1284e ("isisd,yang: add algorithm-prefix-sid configuration tree")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 8e861a75e8b426f0944157387699fe1ab322fe8e)

isisd/isis_cli.c
isisd/isis_nb_config.c
yang/frr-isisd.yang

index e6cc794baed9dd89bd6a61d121077391e566f474..93f7bbf753a2710dae732be9be1f9472f518b6ae 100644 (file)
@@ -2015,12 +2015,12 @@ void cli_show_isis_prefix_sid_algorithm(struct vty *vty,
        const char *sid_value_type;
        const char *sid_value;
        bool n_flag_clear;
-       uint32_t algorithm;
+       uint8_t algorithm;
 
        prefix = yang_dnode_get_string(dnode, "prefix");
        sid_value_type = yang_dnode_get_string(dnode, "sid-value-type");
        sid_value = yang_dnode_get_string(dnode, "sid-value");
-       algorithm = yang_dnode_get_uint32(dnode, "algo");
+       algorithm = yang_dnode_get_uint8(dnode, "algo");
        lh_behavior = yang_dnode_get_string(dnode, "last-hop-behavior");
        n_flag_clear = yang_dnode_get_bool(dnode, "n-flag-clear");
 
index 62f84d4745419ac26e40d226559c8cb1fc6c11f6..baa3fb78ddb7fae2f95b749e3cda23cd82f5d1c7 100644 (file)
@@ -2630,14 +2630,14 @@ int isis_instance_segment_routing_algorithm_prefix_sid_create(
        struct isis_area *area;
        struct prefix prefix;
        struct sr_prefix_cfg *pcfg;
-       uint32_t algorithm;
+       uint8_t algorithm;
 
        if (args->event != NB_EV_APPLY)
                return NB_OK;
 
        area = nb_running_get_entry(args->dnode, NULL, true);
        yang_dnode_get_prefix(&prefix, args->dnode, "prefix");
-       algorithm = yang_dnode_get_uint32(args->dnode, "algo");
+       algorithm = yang_dnode_get_uint8(args->dnode, "algo");
 
        pcfg = isis_sr_cfg_prefix_add(area, &prefix, algorithm);
        pcfg->algorithm = algorithm;
index 5d7c739c05d2f7565c702938204085a462abfed9..4ba32b810ae19843fc2711bd4919862bf3e3c02d 100644 (file)
@@ -1922,7 +1922,7 @@ module frr-isisd {
                if set to disable, ISISEXPLICITNULLFlag
                will override the value of ISISPHPFlag";
             leaf algo {
-              type uint32 {
+              type uint8 {
                 range "128..255";
               }
               description