Skip to content

watchcat: use logical network to fix restart_interface #29120

Merged
hnyman merged 2 commits intoopenwrt:openwrt-25.12from
danielfdickinson:pr-cherry-pick-fix-watchcat-interface-does-not-restart
Apr 16, 2026
Merged

watchcat: use logical network to fix restart_interface #29120
hnyman merged 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?

@danielfdickinson
Copy link
Copy Markdown
Contributor Author

@feckert @hnyman @dibdot ping?

@hnyman
Copy link
Copy Markdown
Contributor

hnyman commented Apr 16, 2026

It is just cherry-pick, right?
If you believe the changes to be right also in 25.12 (that doesn't yet deviate much from main/master), just merge it. (I am not quite sure what we should be reviewing there)

@danielfdickinson
Copy link
Copy Markdown
Contributor Author

@hnyman I don't have merge access - just a contributor. I was mistaken because of a UI thing with GitHub, when I thought I did have commit access when I returned from a long hiatus. If the team is willing to have me on board, I would be happy to accept commit privileges (and apply them responsibly).

@hnyman hnyman merged commit dfb74c2 into openwrt:openwrt-25.12 Apr 16, 2026
12 checks passed
@hnyman
Copy link
Copy Markdown
Contributor

hnyman commented Apr 16, 2026

Ok, I merged it.
(I remembered your earlier comment about merge right still being there, so I wondered)

@danielfdickinson
Copy link
Copy Markdown
Contributor Author

Thank you. (And sorry for the confusion).

@danielfdickinson danielfdickinson deleted the pr-cherry-pick-fix-watchcat-interface-does-not-restart branch April 16, 2026 20:43
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.

2 participants