Skip to content

watchcat: use logical network to fix restart_interface #29120

Open
danielfdickinson wants to merge 2 commits intoopenwrt:openwrt-25.12from
danielfdickinson:pr-cherry-pick-fix-watchcat-interface-does-not-restart
Open

watchcat: use logical network to fix restart_interface #29120
danielfdickinson wants to merge 2 commits intoopenwrt:openwrt-25.12from
danielfdickinson:pr-cherry-pick-fix-watchcat-interface-does-not-restart

Conversation

@danielfdickinson
Copy link
Copy Markdown
Contributor

📦 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 only
changing 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

  • OpenWrt Version: OpenWrt 25.12-SNAPSHOT r32848-1f535037b1
  • OpenWrt Target/Subtarget: bcm27xx/bcm2712
  • OpenWrt Device: Raspberry Pi 5 Model B Rev 1.0

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

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)
@github-actions github-actions bot added the OpenWrt 25.12 Issues/PR on branch 25.12 label Apr 11, 2026
@danielfdickinson
Copy link
Copy Markdown
Contributor Author

@hnyman @BKPepe ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OpenWrt 25.12 Issues/PR on branch 25.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant