mORMot2 DailyDaily read of upstream commits

DHCP request ownership and short numeric parsing are corrected

DHCP servers now follow the client state and selected-server rules more closely: NAK frames are cleaned up, requests naming another server are ignored, and stale static addresses are rejected. A follow-up prevents malformed address options from being mistaken for real IPv4 values. Separately, GetExtended stops reading four bytes from one- or two-character invalid input, so services parsing untrusted numeric text should take this edition.

TL;DR

  • Land on build 2.4.16861; builds 2.4.16857 through 2.4.16859 can misinterpret malformed DHCP options 50 or 54 as real addresses.
  • GetExtended now rejects short invalid tokens before its four-byte NAN/INF probe, preventing a potential read past the supplied text.
  • A DHCP REQUEST whose server-identifier names another server is ignored and counted with the new dsmDroppedOtherServer metric.
  • A client explicitly requesting an address that no longer matches its static reservation now receives a NAK instead of a renewal ACK.
  • DHCPNAK frames omit lease, network, boot and rule options, preserve the packet chaddr, and broadcast when no relay is present.
  • DhcpIP4 now returns zero for absent or malformed four-byte options, completing the new REQUEST checks without false NAK or drop decisions.

Upgrade advice

Take build 2.4.16861 as a complete unit if you run TDhcpServer or pass untrusted text to GetExtended. Do not stop on builds 2.4.16857–2.4.16859: the new DHCP option 50/54 decisions depend on DhcpIP4 returning zero for malformed data, which is fixed in 16860. Recheck DHCP REQUEST/NAK traffic, static reservation moves and any persisted numeric TDhcpScopeMetric ordinals after upgrading.

Build2.4.16851 → 2.4.16861
Commits7
Lines+192 -28
Read3 min

6 of 6 entries · 7 commits upstream

Stories
# Entry Category Units
1 High Moved static reservations reject the client’s stale requested address When TDhcpProcess.LockedResponse finds an lsStatic lease, it now reads option 50 into State.Ip4. For SELECTING or INIT-REBOOT requests with an explicit nonzero address different from the reserved p^.IP4, it returns DoError(State, dsmNak) instead of incrementing dsmLeaseRenewed and acknowledging the lease. Fixes mormot.net.dhcp 2d2627f7+17-3

net: NAK requested address is not the one reserved

Impact

After an administrator moves a static reservation, a client presenting the former address is told to restart address acquisition rather than being ACKed with inconsistent state. Requests without option 50 and RENEWING through ciaddr intentionally retain the existing behavior.

Arnaud Bouchez · 08:18 UTC · view the commit on GitHub →

2 High Malformed DHCP address options no longer masquerade as IPv4 values DhcpIP4 in mormot.net.dhcp initializes its TNetIP4 result to zero instead of the option offset. It only replaces zero when the option exists and its length byte equals SizeOf(TNetIP4). Regression tests send three-byte option 50 and 54 payloads and require normal ACK handling. Fixes mormot.net.dhcp a86688a9+16-3

net: fixed DhcpIP4()

Impact

Malformed requested-address data no longer causes a false static-reservation conflict NAK, and malformed server-identifier data no longer makes this server drop the REQUEST as targeting another server. Correct four-byte options and absent options retain their existing meaning on Delphi and FPC.

Public API

  • DhcpIP4behaviour-changed — Absent or non-four-byte options return zero instead of an option-buffer offset interpreted as IPv4.

Arnaud Bouchez · 08:35 UTC · view the commit on GitHub →

3 High DHCP requests selecting another server are ignored TDhcpProcess.LockedResponse in mormot.net.dhcp reads option 54 with DhcpIP4 before processing any dmtRequest lease. If the nonzero server identifier differs from TDhcpScope.ServerIdentifier, it exits through DoError with the new dsmDroppedOtherServer metric and trace reason. Fixes mormot.net.dhcp 6a6f94d3+15-2

net: new DHCP dsmDroppedOtherServer for REQUEST

Impact

In a network with multiple DHCP servers, this server no longer ACKs or NAKs a SELECTING client that chose another server. The new enum member shifts the numeric ordinals of later TDhcpScopeMetric values, so code or storage using raw metric ordinals or set bit positions should be reviewed.

Worth a look

Check multi-server REQUEST traces and search for persisted Ord(TDhcpScopeMetric) values or numeric TDhcpScopeMetrics masks.

Public API

  • TDhcpScopeMetric.dsmDroppedOtherServeradded — Counts REQUEST packets whose server-identifier selects another DHCP server.

Arnaud Bouchez · 08:17 UTC · view the commit on GitHub →

4 High Short invalid numeric text no longer triggers a four-byte read In the non-WIN32DELPHI GetExtended implementation in mormot.core.text, the non-digit path now checks P[1] and P[2] for NUL before reading PCardinal(P)^ to recognize NAN or INF. One- and two-character invalid tokens jump directly to the existing error path. Fixes mormot.core.text 0a750051+5-2

core: avoid potential read overflow in GetExtended()

Impact

FPC and non-Win32 Delphi services parsing a short invalid buffer avoid a potential read past the supplied NUL-terminated text, which could otherwise touch inaccessible memory. Valid numbers and the public signature are unchanged; Delphi Win32 keeps its separate x87 assembly parser.

Arnaud Bouchez · 08:15 UTC · view the commit on GitHub →

5 Low DHCP regression tests cover REQUEST state transitions test.net.proto adds cases for matching and moved static reservations, INIT-REBOOT and SELECTING NAKs, RENEWING through ciaddr, offers after NAK, and static or dynamic REQUEST packets selecting another server. test.core.base also adds a GetExtended('0.0') regression assertion. Tests a0347464+73-3

tests: cover latest DHCP fixes

Impact

No application code or public API changes. The test matrix records which DHCP client states should be ignored, ACKed, NAKed or offered a reservation, reducing regression risk for Delphi and FPC server builds.

Arnaud Bouchez · 08:24 UTC · view the commit on GitHub →

6 Low DHCP malformed-option tests return inside the protected test body test.net.proto moves the finally keyword below the malformed option 50 and 54 assertions. Those assertions now run in the try body, while server.Free and settings.Free remain in the finally block and execute even if a check raises. Tests d3ed9070+4-3

tests: fixed typo on previous commit

Impact

No application code or public API changes. A failing malformed-option assertion can no longer skip the intended test-resource cleanup, so the regression suite reports failures with safer cleanup on Delphi and FPC.

Arnaud Bouchez · 08:37 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits977
Active days44/60
Busiest2026-09-30
Peak60
2026-08-15: 0 commits2026-08-16: 0 commits2026-08-17: 0 commits2026-08-18: 0 commits2026-08-19: 0 commits2026-08-20: 0 commits2026-08-21: 0 commits2026-08-22: 0 commits2026-08-23: 0 commits2026-08-24: 0 commits2026-08-25: 0 commits2026-08-26: 0 commits2026-08-27: 26 commits2026-08-28: 11 commits2026-08-29: 10 commits2026-08-30: 1 commit2026-08-31: 23 commits2026-09-01: 0 commits2026-09-02: 20 commits2026-09-03: 29 commits2026-09-04: 35 commits2026-09-05: 13 commits2026-09-06: 0 commits2026-09-07: 0 commits2026-09-08: 23 commits2026-09-09: 10 commits2026-09-10: 17 commits2026-09-11: 23 commits2026-09-12: 14 commits2026-09-13: 9 commits2026-09-14: 7 commits2026-09-15: 4 commits2026-09-16: 24 commits2026-09-17: 26 commits2026-09-18: 21 commits2026-09-19: 59 commits2026-09-20: 13 commits2026-09-21: 5 commits2026-09-22: 34 commits2026-09-23: 17 commits2026-09-24: 57 commits2026-09-25: 22 commits2026-09-26: 26 commits2026-09-27: 0 commits2026-09-28: 2 commits2026-09-29: 19 commits2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 33 commits2026-10-11: 9 commits2026-10-12: 11 commits2026-10-13: 35 commits
2026-08-152026-10-13