dhcp: lease infinite is a value, and the binding it grants never lapses #1776

Merged
jaylouisw merged 1 commit from rev/1117-0230 into main 2026-11-17 03:15:29 +00:00
Owner

The vendor states the command with two forms and names the word:

lease {days [hours [minutes]] | infinite} ... infinite — Specifies that the duration of the lease is unlimited.
— Cisco IOS IP Addressing Services Command Reference, lease

This console parsed the three numbers and nothing else. One session on an ISR 4331, before:

r1(dhcp-config)#lease infinite
% Incomplete command: lease <days> [hours] [minutes]
r1#show ip dhcp pool lan
  Lease:          86400s

Three wrong answers from one word: the word was refused as incomplete (nothing was missing), the pool silently kept
the 1-day default, and the pool view reported that default as if it were configured.

What changed

  • engine/dhcp.js — the pool's leaseSec may be the word infinite, carried through normalizePool() and accepted
    by validatePool(); leaseSeconds() returns 0xffffffff for it (RFC 2131 §3.3 reserves that value for
    "infinity"); recordLease() gives such a lease expiresStep = Infinity, which no run reaches and expireLeases()
    never collects; leaseTable() reports remainingSec = Infinity and the state active; a saved document writes the
    word (JSON has no Infinity) and reads it back.
  • engine/cli.js — lease infinite is accepted in the pool sub-mode, and lease infinite 5 is refused naming both
    forms; the incomplete-command line advertises the word; show running-config prints lease infinite;
    show ip dhcp pool prints Lease: Infinite (never expires); show ip dhcp binding prints Infinite in the
    Expires in column, which is the vendor's own word for that cell in a binding table
    (Cisco Business 250 CLI Guide
    prints Infinite Automatic / Infinite Static).
  • engine/simulator.js — the granted lease is read through leaseSeconds(), so the ACK carries 0xffffffff instead
    of NaN, which is what Number('infinite') had made of it.
  • test/dhcp-infinite-lease.test.js (24 assertions) — acceptance, read-back, a binding that survives a hundred seconds
    while the one-minute control in the same lab expires, the save/restore round trip, and the two refusals.
  • test/help-completeness.test.js — the advertised list now proves lease <days> <hours> <minutes> and
    lease infinite, matching the help line and docs/CLI.md.
  • research/dhcp-infinite-lease.md — evidence, what is inferred (the word in a binding row for an automatic lease),
    and what is unresolved (sub-mode keyword abbreviation; whether an all-zero duration means infinite on any IOS
    release; the trailing-minutes padding of the numeric form).

Gates

  • node scripts/syntax-check.js — 372 files, all OK.
  • npm test — 301 suites, 10,569 assertions, 0 failed (723 s).

lease 0 is still refused as a zero-length lease rather than read as a synonym: none of the references read for this
run says an all-zero duration is infinite, and research/dhcp-infinite-lease.md says so out loud.

The vendor states the command with two forms and names the word: > `lease {days [hours [minutes]] | infinite}` ... `infinite` — Specifies that the duration of the lease is unlimited. > — [Cisco IOS IP Addressing Services Command Reference, `lease`](https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr/command/ipaddr-cr-book/ipaddr-l1.html) This console parsed the three numbers and nothing else. One session on an ISR 4331, before: ``` r1(dhcp-config)#lease infinite % Incomplete command: lease <days> [hours] [minutes] r1#show ip dhcp pool lan Lease: 86400s ``` Three wrong answers from one word: the word was refused as *incomplete* (nothing was missing), the pool silently kept the 1-day default, and the pool view reported that default as if it were configured. ## What changed * `engine/dhcp.js` — the pool's `leaseSec` may be the word `infinite`, carried through `normalizePool()` and accepted by `validatePool()`; `leaseSeconds()` returns `0xffffffff` for it (RFC 2131 §3.3 reserves that value for "infinity"); `recordLease()` gives such a lease `expiresStep = Infinity`, which no run reaches and `expireLeases()` never collects; `leaseTable()` reports `remainingSec = Infinity` and the state `active`; a saved document writes the word (JSON has no `Infinity`) and reads it back. * `engine/cli.js` — `lease infinite` is accepted in the pool sub-mode, and `lease infinite 5` is refused naming both forms; the incomplete-command line advertises the word; `show running-config` prints `lease infinite`; `show ip dhcp pool` prints `Lease: Infinite (never expires)`; `show ip dhcp binding` prints `Infinite` in the `Expires in` column, which is the vendor's own word for that cell in a binding table ([Cisco Business 250 CLI Guide](https://www.cisco.com/c/en/us/td/docs/switches/lan/csbms/CBS_250_350/CLI/cbs-250-cli/dhcp-server-commands.html) prints `Infinite Automatic` / `Infinite Static`). * `engine/simulator.js` — the granted lease is read through `leaseSeconds()`, so the ACK carries `0xffffffff` instead of `NaN`, which is what `Number('infinite')` had made of it. * `test/dhcp-infinite-lease.test.js` (24 assertions) — acceptance, read-back, a binding that survives a hundred seconds while the one-minute control in the same lab expires, the save/restore round trip, and the two refusals. * `test/help-completeness.test.js` — the advertised list now proves `lease <days> <hours> <minutes>` and `lease infinite`, matching the help line and docs/CLI.md. * `research/dhcp-infinite-lease.md` — evidence, what is inferred (the word in a binding row for an *automatic* lease), and what is unresolved (sub-mode keyword abbreviation; whether an all-zero duration means infinite on any IOS release; the trailing-minutes padding of the numeric form). ## Gates * `node scripts/syntax-check.js` — 372 files, all OK. * `npm test` — **301 suites, 10,569 assertions, 0 failed** (723 s). `lease 0` is still refused as a zero-length lease rather than read as a synonym: none of the references read for this run says an all-zero duration is infinite, and `research/dhcp-infinite-lease.md` says so out loud.
dhcp: lease infinite is a value, and the binding it grants never lapses
All checks were successful
CI / Classify the change (pull_request) Successful in 8s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 11s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m1s
CI / Test (Node 22) (pull_request) Successful in 58s
CI / Arm auto-merge (pull_request) Successful in 5s
326edc8640
The vendor states `lease {days [hours [minutes]] | infinite}` in the IOS IP
Addressing Services Command Reference, with `infinite` meaning "the duration of
the lease is unlimited". This console parsed the three numbers only, so the word
a printer pool actually wants was refused as `Incomplete command: lease <days>
[hours] [minutes]` - a complaint about a missing argument for a command typed in
full - the pool silently kept the 1-day default, and `show ip dhcp pool` then
reported 86400s as if that were configured.

The word is now the pool's value: normalizePool/validatePool carry it,
leaseSeconds() sends 0xffffffff (RFC 2131 3.3's "infinity"), recordLease() sets
expiresStep to Infinity so expireLeases() never collects it, the saved document
writes/reads the word (JSON has no Infinity), running-config prints `lease
infinite`, the pool view says Infinite (never expires) and the binding table's
Expires in column says Infinite - the vendor's word for that cell.

research/dhcp-infinite-lease.md records the evidence, what is inferred (the word
in a binding row for an automatic lease) and what is left unresolved (sub-mode
keyword abbreviation, and whether an all-zero duration means infinite anywhere).
jaylouisw force-pushed rev/1117-0230 from 326edc8640
All checks were successful
CI / Classify the change (pull_request) Successful in 8s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 11s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m1s
CI / Test (Node 22) (pull_request) Successful in 58s
CI / Arm auto-merge (pull_request) Successful in 5s
to edf552b15b
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 18s
CI / Test (Node 20) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m5s
CI / Server smoke test (pull_request) Successful in 7s
CI / Docker build (pull_request) Successful in 23s
CI / Arm auto-merge (pull_request) Successful in 8s
2026-11-17 03:03:34 +00:00
Compare
jaylouisw force-pushed rev/1117-0230 from edf552b15b
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 18s
CI / Test (Node 20) (pull_request) Successful in 57s
CI / Test (Node 22) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m5s
CI / Server smoke test (pull_request) Successful in 7s
CI / Docker build (pull_request) Successful in 23s
CI / Arm auto-merge (pull_request) Successful in 8s
to 89061bf344
All checks were successful
CI / Classify the change (pull_request) Successful in 39s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 31s
CI / Server smoke test (pull_request) Successful in 9s
CI / Docker build (pull_request) Successful in 26s
CI / Test (Node 20) (pull_request) Successful in 59s
CI / Test (Node 22) (pull_request) Successful in 1m3s
CI / Test (Node 18) (pull_request) Successful in 1m10s
CI / Arm auto-merge (pull_request) Successful in 11s
2026-11-17 03:06:07 +00:00
Compare
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-17 03:13:50 +00:00
jaylouisw force-pushed rev/1117-0230 from 89061bf344
All checks were successful
CI / Classify the change (pull_request) Successful in 39s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 31s
CI / Server smoke test (pull_request) Successful in 9s
CI / Docker build (pull_request) Successful in 26s
CI / Test (Node 20) (pull_request) Successful in 59s
CI / Test (Node 22) (pull_request) Successful in 1m3s
CI / Test (Node 18) (pull_request) Successful in 1m10s
CI / Arm auto-merge (pull_request) Successful in 11s
to 0c3a252aa7
All checks were successful
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 3s
CI / Classify the change (pull_request) Successful in 8s
CI / Test (Node 18) (pull_request) Has been skipped
CI / Test (Node 20) (pull_request) Has been skipped
CI / Test (Node 22) (pull_request) Has been skipped
CI / Server smoke test (pull_request) Has been skipped
CI / Docker build (pull_request) Has been skipped
CI / Arm auto-merge (pull_request) Has been skipped
2026-11-17 03:14:59 +00:00
Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1776
No description provided.