Skip to content

Commit 94a94e8

Browse files
ton31337cscarpitta
authored andcommitted
ripngd: Make sure we do not overuse higher values for ECMP count
Use a minimum value of a CLI version and a value of Zebra capabilities. Signed-off-by: Donatas Abraitis <[email protected]>
1 parent 517b10e commit 94a94e8

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

ripngd/ripng_main.c

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ struct option longopts[] = {{0}};
3232
/* ripngd privileges */
3333
zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN};
3434

35+
uint32_t zebra_ecmp_count = MULTIPATH_NUM;
36+
3537
struct zebra_privs_t ripngd_privs = {
3638
#if defined(FRR_USER)
3739
.user = FRR_USER,

ripngd/ripng_nb_config.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ int ripngd_instance_allow_ecmp_modify(struct nb_cb_modify_args *args)
129129
return NB_OK;
130130

131131
ripng = nb_running_get_entry(args->dnode, NULL, true);
132-
ripng->ecmp = yang_dnode_get_uint8(args->dnode, NULL);
132+
ripng->ecmp =
133+
MIN(yang_dnode_get_uint8(args->dnode, NULL), zebra_ecmp_count);
133134
if (!ripng->ecmp) {
134135
ripng_ecmp_disable(ripng);
135136
return NB_OK;

ripngd/ripng_zebra.c

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
/* All information about zebra. */
2222
struct zclient *zclient = NULL;
23-
uint32_t zebra_ecmp_count = MULTIPATH_NUM;
2423

2524
/* Send ECMP routes to zebra. */
2625
static void ripng_zebra_ipv6_send(struct ripng *ripng, struct agg_node *rp,

ripngd/ripngd.h

+2
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,6 @@ extern void ripng_vrf_init(void);
435435
extern void ripng_vrf_terminate(void);
436436
extern void ripng_cli_init(void);
437437

438+
extern uint32_t zebra_ecmp_count;
439+
438440
#endif /* _ZEBRA_RIPNG_RIPNGD_H */

0 commit comments

Comments
 (0)