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

Aperta
#5,824 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php
Ambito
networking

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
PHP
Stelle
1.2k
Fork
932
Merge medio
1g 11h
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opnsense/plugins

Tutte le issue di opnsense/plugins

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.