net/isc-dhcp: prefixes.php re-adds released DHCPv6-PD routes from historical active lease records

オープン
#5,824 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
networking

調査の方向性

Start with net/isc-dhcp/src/opnsense/scripts/dhcp/prefixes.php and the supplied active-then-released lease fixture; trace how repeated IA_PD declarations and release log entries feed route updates. The report identifies the expected behavior: the latest declaration determines bindings, so the released prefix is not re-added and an active reassignment uses its current owner. Validate in an isolated harness that records route calls.

索引モデルが issue の本文から書いたものです。

説明

support

Important notices

  • I have read the contributing guidelines.
  • I have searched open and closed issues in plugins and related core issues and found no exact match.
  • The title identifies the plugin.

Describe the bug

I observed stale routes to downstream delegated IPv6 prefixes after a DHCPv6 client released a prefix. The problem is in net/isc-dhcp/src/opnsense/scripts/dhcp/prefixes.php, rather than a claim that the DHCP server incorrectly accepts the Release.

The helper accumulates historical active IA_PD records from the append-only dhcpd6.leases file. A later released record for the same IA does not invalidate the earlier active entry. When building routes, that historical entry can also overwrite the deletion collected from a "releases prefix" log entry.

Consequently, the helper deletes and then re-adds a route for a prefix whose latest lease state is released.

Environment

  • OPNsense 26.7.7
  • Package: os-isc-dhcp-1.0_7
  • ISC DHCPv6 server providing downstream prefix delegation on LAN.
  • First affected version and last known working version: unknown.
  • No specific GUI action is needed to trigger the parser defect. Relevant configuration: Services → ISC DHCPv6 → LAN → Prefix Delegation Range.
  • I checked the current upstream prefixes.php; it still contains the relevant logic (file blob SHA 92880ea10f1b03650ce9ce9093f064eada1114bf).

To reproduce

Minimal synthetic lease contents, in this order (documentation addresses; the repeated IA_PD identity is intentional):

ia-na "\000\000\000\001\000\252" {
  iaaddr 2001:db8::a {
    binding state active;
    ends never;
  }
}
ia-pd "\000\000\000\001\000\252" {
  iaprefix 2001:db8:10::/56 {
    binding state active;
    ends never;
  }
}
ia-pd "\000\000\000\001\000\252" {
  iaprefix 2001:db8:10::/56 {
    binding state released;
    ends never;
  }
}
  1. Run the original helper against this fixture in an isolated test harness.
  2. Replace only the lease-file path. Stub the config/interface/plugin includes, return no static mappings and no DHCP log, and record mwexecfm()/mwexecf() calls instead of executing route commands. Preserve IAID/DUID decoding semantics.
  3. The recorded route arguments are:
{"delete":["2001:db8:10::/56"]}
{"add":["2001:db8:10::/56","2001:db8::a"]}

The route is explicitly re-added despite the final released declaration. A matching "releases prefix" log entry cannot resolve this: the later "collect active leases" loop overwrites its null route entry with the historical address.

Please do not run this fixture against the real routing table or replace a production lease database.

Expected behavior

The latest complete declaration for each IA type and IAID/DUID identity should determine its current bindings. A released prefix should not be re-added based on an older active record. If a prefix is legitimately reassigned to another client, routing should use the current active owner.

ISC documents that repeated lease declarations are normal and the last declaration represents the current state: dhcpd.leases manual.

Observed impact and validation

On my installation, after HomePod DHCPv6-PD release/reassignment activity, I observed a route remaining for a released /64 and another delegated /64 still routed to its former holder. The synthetic active → released reproduction above isolates the first defect independently of Apple/Thread behavior. I do not know why the HomePod chose to release its lease.

The regression was reproduced against a saved copy of the unmodified packaged helper. The isolated harness used fake includes and function-source guards before any route operation. A local experimental parser correction stopped re-adding the released route; I am requesting an upstream fix rather than assuming that local change is the appropriate upstream implementation. My installation currently has that local workaround, so the reproduction above specifically refers to the original helper.

No production addresses, DUIDs, configuration exports or packet captures are included.

This report and the isolated investigation were assisted by OpenAI Codex (GPT-6).

主要言語
PHP
スター
1.2k
フォーク
932
平均マージ
1日 11時間
マージ済み PR(30日)
22

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opnsense/plugins のほかの issue

opnsense/plugins の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。