]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripngd: Make sure we do not overuse higher values for ECMP count 13535/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 17 May 2023 19:17:02 +0000 (22:17 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 23 May 2023 06:29:02 +0000 (09:29 +0300)
Use a minimum value of a CLI version and a value of Zebra capabilities.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
ripngd/ripng_main.c
ripngd/ripng_nb_config.c
ripngd/ripng_zebra.c
ripngd/ripngd.h

index 1d392efdde9bfe3079091551cd767f7ea08cdffa..9933dae5cd762c24d305eb9599a73dfc2c9beb37 100644 (file)
@@ -32,6 +32,8 @@ struct option longopts[] = {{0}};
 /* ripngd privileges */
 zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN};
 
+uint32_t zebra_ecmp_count = MULTIPATH_NUM;
+
 struct zebra_privs_t ripngd_privs = {
 #if defined(FRR_USER)
        .user = FRR_USER,
index de723193543e53a7a803903f3bb366f0f6d2fa18..0b1bd68eca20ab7db4b4cdc7ab54b368b3ec3e43 100644 (file)
@@ -129,7 +129,8 @@ int ripngd_instance_allow_ecmp_modify(struct nb_cb_modify_args *args)
                return NB_OK;
 
        ripng = nb_running_get_entry(args->dnode, NULL, true);
-       ripng->ecmp = yang_dnode_get_uint8(args->dnode, NULL);
+       ripng->ecmp =
+               MIN(yang_dnode_get_uint8(args->dnode, NULL), zebra_ecmp_count);
        if (!ripng->ecmp) {
                ripng_ecmp_disable(ripng);
                return NB_OK;
index 6122c4255ce50ac34665972b955c63e073378ffc..49b8a197add15d457251c4fad629463472aedd95 100644 (file)
@@ -20,7 +20,6 @@
 
 /* All information about zebra. */
 struct zclient *zclient = NULL;
-uint32_t zebra_ecmp_count = MULTIPATH_NUM;
 
 /* Send ECMP routes to zebra. */
 static void ripng_zebra_ipv6_send(struct ripng *ripng, struct agg_node *rp,
index 3d13097dd6accea00e6cf5ad49ddcf35f5dca3ae..c7468b6317c57ef4afcd7d36ea7093fc25248677 100644 (file)
@@ -435,4 +435,6 @@ extern void ripng_vrf_init(void);
 extern void ripng_vrf_terminate(void);
 extern void ripng_cli_init(void);
 
+extern uint32_t zebra_ecmp_count;
+
 #endif /* _ZEBRA_RIPNG_RIPNGD_H */