keep forwarding during interface reload#124
Conversation
144bd1f to
22dbbb7
Compare
|
Hello @brauliobo, thank you for contribution. A few things I'd like to point out:
@egc112 -- let me know when you're done with 1.2.2 patches so I can task copilot/claude to reimplement them in the ucode (1.2.3) version. If the ghost wan6 reloads fix doesn't resolve the situation @brauliobo, we can revisit this PR. |
|
Yes Stan, please go ahead I know several people have tested 1.2.2-r18 which has these fixes and did not encounter problems. So push the fixes to the Openwrt main repo for further testing. |
|
@brauliobo thanks for your contribution PBR acts on a procd trigger (e.g. up down, update etc .) Of course if you do not want it you can simply disable However we identified a case where the wan6 interface was triggered but a reloading was not necessary at all. We already implemented fixes for that, you can test it see: see: https://forum.openwrt.org/t/policy-based-routing-pbr-package-discussion/140639/2850 Please test and let us know if that fixes your problem, please also report in the 9PBR discussion thread](https://forum.openwrt.org/t/policy-based-routing-pbr-package-discussion/140639/2850) |
Summary
This avoids disabling forwarding for
on_interface_reloadstarts.Full service starts, reloads, and restarts keep the existing
stop_forward/enable_forwardbehavior. Only targeted interface reloads skip the forwarding toggle.Motivation
On a router with several IPv6 WANs, normal RA/DHCPv6 refreshes can trigger frequent
interface.*events. In my case,wan_str6advertises short public IPv6 and prefix lifetimes of roughly 3-5 minutes, andwan_vivo6has an RA default route lifetime around 3 minutes.Those events cause repeated PBR
on_interface_reloadruns. Because the init wrapper disables forwarding before calling the ucode start logic, each targeted interface reload briefly interrupts LAN forwarding. The user-visible symptom was streaming traffic, especially YouTube, playing for a while, freezing for tens of seconds, then resuming, repeatedly.The selected policy path was healthy: YouTube was routed through
wan_tim, not the noisywan_str6path. The interruption correlated with repeated PBR interface reloads rather than WAN packet loss.Router observations
Environment where reproduced:
wan_vivo,wan_tim,wan_str, plus IPv6 peerswan_timProcessing environment (on_interface_reload)logs from IPv6 RA/DHCPv6 refreshesExamples from the router:
ubus monitorshowednetwork.interface notify_protoupdates for IPv6 interfaces such aswan_vivo6andwan_str6shortly before PBR reloads.wan_timwas stable during testing:Validation
I tested the same logic on the affected router before opening this PR.
Validation performed:
/etc/init.d/pbrash -n /etc/init.d/pbr/etc/init.d/pbr on_interface_reload wan_str6/proc/sys/net/ipv4/ip_forwardstayed1ip_forwardstayed1throughout repeatedon_interface_reloadeventswan_timfor IPv4 and IPv6tim-wanreturned HTTP204Representative route checks after the change:
Notes
This is intentionally minimal. The init wrapper currently disables forwarding before the ucode start logic resolves whether a reload remains a targeted
on_interface_reloador falls back to a full start. This patch uses the init command parameter as the guard, so the common targeted interface-reload path avoids the forwarding interruption while full reload/restart paths remain unchanged.If you prefer the guard to use the resolved ucode
service_start_trigger, I can follow up with a slightly larger refactor where ucode exposes that decision before the forwarding toggle.