[os-upnp] miniupnpd is unnecessarily restarted on IPv6 WAN renewals
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先阅读 net/upnp 中的 newwanip hook,以及它调用的 miniupnpd_configure_do 回调。检查该 hook 如何传递 WAN 事件参数,以及回调如何处理 inet 和 inet6。完成标准是 IPv4 续租仍会重启 miniupnpd,而 IPv6 续租不会;issue 需要报告已在本地对两个地址族进行验证。
由索引模型根据 Issue 内容生成。
描述
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Bug description
The miniupnpd service is restarted on IPv6 WAN renewals, although its IPv4-facing UPnP configuration has not changed.
The newwanip hook in net/upnp currently invokes miniupnpd_configure_do for both IPv4 and IPv6 WAN address events. The callback does not inspect the address family, so an IPv6 renewal stops and starts miniupnpd unnecessarily.
On my OPNsense system this was reproducible with a PPPoE WAN. During a PPPoE reconnect, the IPv4 address change should trigger a miniupnpd restart; subsequent IPv6 address events should not trigger further restarts.
Environment
- OPNsense 26.7.10p1
- os-upnp 1.10_1
- miniupnpd 2.3.11_2,1
- FreeBSD 15 amd64
- PPPoE WAN interface (
pppoe0)
Steps to reproduce
- Enable UPnP and run miniupnpd with a PPPoE WAN.
- Trigger a WAN reconnect or another event that causes the IPv4 and IPv6 WAN address hooks to run.
- Observe miniupnpd process start/stop events.
- The IPv6 WAN renewal also invokes the miniupnpd restart callback.
Expected behaviour
Only IPv4 WAN address changes should trigger this newwanip restart. IPv6 WAN renewals should leave the miniupnpd process and its active state untouched.
Proposed change
Pass the hook arguments to the callback and ignore calls for address families other than inet:
'newwanip' => ['miniupnpd_configure_do:3'],
function miniupnpd_configure_do($verbose = false, $interfaces = [], $family = 'inet')
{
global $config;
if ($family !== 'inet') {
return;
}
miniupnpd_stop();
// existing configuration/start logic remains unchanged
}
The proposed change is intentionally limited to the newwanip hook and its callback. It does not alter miniupnpd startup behaviour or IPv6 UPnP functionality.
The default value inet preserves the existing boot-hook behaviour, where the callback is invoked without WAN-event arguments.
Validation
I applied this change locally and verified PHP syntax and the callback behaviour for both inet and inet6, including invocation through the plugin dispatcher.
During a real PPPoE reconnect, the IPv4 public address changed and miniupnpd restarted once for the IPv4 event. Subsequent IPv6 renewal events did not cause additional restarts. The UPnP lease remained present and the Xbox reported an Open NAT status.
A lease-file disappearance had also been observed during earlier testing, but its precise cause was not conclusively established; I am not attributing that behaviour to this callback issue.
The patch is intended as a minimal fix to avoid restarting miniupnpd on IPv6 WAN renewals.
- 主要语言
- PHP
- 星标
- 1.2k
- 派生
- 932
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
opnsense/plugins 的其他 Issue
-
www/squid: configctl proxy stop returns before Squid exits, so stop+start (e.g. Monit restart) fails未关闭support
难度 2/5 1-3 小时 新手友好度 70/100
opnsense/plugins#5983 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directive可能已有人在做 @fraenki 于 6 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
opnsense/plugins#5973 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)可能已有人在做 @bringha1 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
iruzen-dono/workless#117 ·
维护者通常 1 天内回复
-
area/tests type/bug when/soon
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbook可能已有人在做 @mayankmajeji 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
WordPress/hosting-handbook#521 ·
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
unraid/community.applications#153 ·