forked from Mirror/frr
Merge pull request #13548 from opensourcerouting/fix/use_min_value_of_cli_zebra_cap_ecmp
ripd: Make sure we do not overuse higher values for ECMP count
This commit is contained in:
commit
6a88c7a87e
|
@ -34,6 +34,8 @@ static struct option longopts[] = {{0}};
|
||||||
/* ripd privileges */
|
/* ripd privileges */
|
||||||
zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN};
|
zebra_capabilities_t _caps_p[] = {ZCAP_NET_RAW, ZCAP_BIND, ZCAP_SYS_ADMIN};
|
||||||
|
|
||||||
|
uint32_t zebra_ecmp_count = MULTIPATH_NUM;
|
||||||
|
|
||||||
struct zebra_privs_t ripd_privs = {
|
struct zebra_privs_t ripd_privs = {
|
||||||
#if defined(FRR_USER)
|
#if defined(FRR_USER)
|
||||||
.user = FRR_USER,
|
.user = FRR_USER,
|
||||||
|
|
|
@ -99,7 +99,8 @@ int ripd_instance_allow_ecmp_modify(struct nb_cb_modify_args *args)
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
||||||
rip = nb_running_get_entry(args->dnode, NULL, true);
|
rip = nb_running_get_entry(args->dnode, NULL, true);
|
||||||
rip->ecmp = yang_dnode_get_uint8(args->dnode, NULL);
|
rip->ecmp =
|
||||||
|
MIN(yang_dnode_get_uint8(args->dnode, NULL), zebra_ecmp_count);
|
||||||
if (!rip->ecmp) {
|
if (!rip->ecmp) {
|
||||||
rip_ecmp_disable(rip);
|
rip_ecmp_disable(rip);
|
||||||
return NB_OK;
|
return NB_OK;
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
/* All information about zebra. */
|
/* All information about zebra. */
|
||||||
struct zclient *zclient = NULL;
|
struct zclient *zclient = NULL;
|
||||||
uint32_t zebra_ecmp_count = MULTIPATH_NUM;
|
|
||||||
|
|
||||||
/* Send ECMP routes to zebra. */
|
/* Send ECMP routes to zebra. */
|
||||||
static void rip_zebra_ipv4_send(struct rip *rip, struct route_node *rp,
|
static void rip_zebra_ipv4_send(struct rip *rip, struct route_node *rp,
|
||||||
|
|
|
@ -539,4 +539,6 @@ DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc));
|
||||||
|
|
||||||
extern void rip_ecmp_change(struct rip *rip);
|
extern void rip_ecmp_change(struct rip *rip);
|
||||||
|
|
||||||
|
extern uint32_t zebra_ecmp_count;
|
||||||
|
|
||||||
#endif /* _ZEBRA_RIP_H */
|
#endif /* _ZEBRA_RIP_H */
|
||||||
|
|
Loading…
Reference in a new issue