watchcat: use logical network to fix restart_interface #29120
Open
danielfdickinson wants to merge 2 commits intoopenwrt:openwrt-25.12from
Open
watchcat: use logical network to fix restart_interface #29120danielfdickinson wants to merge 2 commits intoopenwrt:openwrt-25.12from
danielfdickinson wants to merge 2 commits intoopenwrt:openwrt-25.12from
Conversation
As reported in openwrt#23410 Network interface reset doesn't work as expected on a Wireguard VPN interface and in openwrt#27927 lt2p interface won't reboot, and mentioned in openwrt#27248, the current implementation of the option to restart an interface when connectivity check fails for some period does not result in an interface restart for all interface. Notably 'virtual' interfaces such as Wireguard and L2TP do not restart. The solution that works is to use `ifup <interface>` instead of only changing the link status. This commit is based on the one in openwrt#27248 by @rondoval, who unfortunately has not updated the commit message as requested for half a year. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca> (cherry picked from commit 14e0e9e)
Watchcat was failing to restart layer-3 interfaces when in mode 'restart_iface'. The previously attempted fix made the situation worse in that it resulted in layer 2 interfaces also failing to start. This was because we are passed the interface name (e.g. eth0, l2p0, or br-lan), but ifup needs the logical network (e.g. 'lan' which corresponds to the network device). Update to use find_config from /lib/network/config.sh to find the logical network from the interface name, and use ifup on the logical network to restart the underlying interface(s) associated with the logical network. Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca> (cherry picked from commit c3a85b9)
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📦 Package Details
Maintainer: @roger-
Description:
As reported in #23410 Network interface reset doesn't work as expected
on a Wireguard VPN interface and in #27927 lt2p interface won't reboot,
and mentioned in #27248, the current implementation of the option to
restart an interface when connectivity check fails for some period does
not result in an interface restart for all interface.
Notably 'virtual' interfaces such as Wireguard and L2TP do not restart.
The solution that works is to use
ifup <interface>instead of onlychanging the link status.
This commit is based on the one in #27248 by @rondoval, who unfortunately
has not updated the commit message as requested for half a year.
and an update:
Watchcat was failing to restart layer-3 interfaces when in mode
'restart_iface'. The previously attempted fix made the situation
worse in that it resulted in layer 2 interfaces also failing to
start.
This was because we are passed the interface name (e.g. eth0,
l2p0, or br-lan), but ifup needs the logical network (e.g. 'lan'
which corresponds to the network device).
Update to use find_config from /lib/network/config.sh to find the
logical network from the interface name, and use ifup on the
logical network to restart the underlying interface(s) associated
with the logical network.
🧪 Run Testing Details
✅ Formalities