[os-upnp] miniupnpd is unnecessarily restarted on IPv6 WAN renewals
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、net/upnp の newwanip フックと、それが呼び出す miniupnpd_configure_do コールバックを読んでください。フックが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時間
- マージ済み PR(30日)
- 22
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
opnsense/plugins の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/blocks-engine#7881 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
iruzen-dono/workless#117 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
magicsunday/webtrees-docker#285 ·
メンテナーはふだん 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 ·