diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-08-24 17:16:05 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-08-24 17:16:06 +0200 |
commit | 454e9c33c90691d5bea12263f1801a7dc38c20b1 (patch) | |
tree | 154f2686e32113e53e4504f1a42a41ab5809406b /system-linux.c | |
parent | 6519cf31e4b033fd4a03c031ad882166be84fa6d (diff) | |
download | netifd-454e9c33c90691d5bea12263f1801a7dc38c20b1.tar.gz |
bridge: tune default stp parameters
The default forwarding delay 2 is broken and makes STP non-functional by
default. The kernel's default of 15 is rather long.
This commit changes makes the timer settings more aggressive than the
kernel's default while still being consistent and allowing proper
convergence for a network diameter up to 4
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'system-linux.c')
-rw-r--r-- | system-linux.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/system-linux.c b/system-linux.c index e9a19f7..85942a5 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1276,21 +1276,17 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg) snprintf(buf, sizeof(buf), "%d", cfg->priority); system_bridge_set_priority(bridge, buf); + snprintf(buf, sizeof(buf), "%lu", sec_to_jiffies(cfg->hello_time)); + system_bridge_set_hello_time(bridge, buf); + + snprintf(buf, sizeof(buf), "%lu", sec_to_jiffies(cfg->max_age)); + system_bridge_set_max_age(bridge, buf); + if (cfg->flags & BRIDGE_OPT_AGEING_TIME) { snprintf(buf, sizeof(buf), "%lu", sec_to_jiffies(cfg->ageing_time)); system_bridge_set_ageing_time(bridge, buf); } - if (cfg->flags & BRIDGE_OPT_HELLO_TIME) { - snprintf(buf, sizeof(buf), "%lu", sec_to_jiffies(cfg->hello_time)); - system_bridge_set_hello_time(bridge, buf); - } - - if (cfg->flags & BRIDGE_OPT_MAX_AGE) { - snprintf(buf, sizeof(buf), "%lu", sec_to_jiffies(cfg->max_age)); - system_bridge_set_max_age(bridge, buf); - } - return 0; } |