Saving the DHCP relay card checks the circuit and remote IDs against the stored settings, not the startup values #315

Merged
claude merged 1 commit from feature/62-relay-settings-current-values into develop 2026-11-05 14:27:34 -05:00
Owner

Saving the DHCP relay card now checks the circuit and remote IDs against the stored settings, not the startup values, and the RA protocol card does the same for its interval pair.

  • DhcpSettingsController.PatchRelay reads the unpatched ID from IOptionsMonitor<Dhcpv4RelayOptions>.CurrentValue; PatchRaProtocol reads the unpatched min/max interval from IOptionsMonitor<RaProtocolOptions>.CurrentValue (the same mechanism GetCore/GetRa use). One read per PATCH, so both fields come from one version.
  • Startup/DhcpServiceRegistration.cs: Dhcpv4RelayOptions is now bound when the relay is off too (the opposite branch of AddNinlilDhcpv4Relay, so no double registration), so a saved relay setting reaches the monitor in the default setup. GET relay with the relay off now shows the stored values instead of compiled defaults. No validation of these options runs at startup, so an unused invalid value cannot stop a start.
  • Traced (verifier): the PATCH writes the default appsettings.json, which the host loads with reload-on-change, and both options are bound with Configure<T>(section), so saved values reach CurrentValue before a restart. A custom RuntimeSettings:ConfigurationFilePath is not watched (pre-existing, shared by the other live reads): filed as #314.
  • Other settings controllers' PATCH validations do not read startup IOptions.Value.

Tests (DhcpSettingsControllerLiveReadTests, controller-level because the shared Web test host's settings file is not a configuration source): a remote ID that overflows the stored circuit ID is refused, one that fits it is accepted although the startup circuit ID would refuse it, and the same pair for the RA min/max ratio; all 4 fail with the startup reads put back. Web.Tests 2085 (without Docker, OpenAPI snapshot unchanged), Relay.Tests 36; build 0 warnings; csharpier clean.

Closes #62

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

Saving the DHCP relay card now checks the circuit and remote IDs against the stored settings, not the startup values, and the RA protocol card does the same for its interval pair. - `DhcpSettingsController.PatchRelay` reads the unpatched ID from `IOptionsMonitor<Dhcpv4RelayOptions>.CurrentValue`; `PatchRaProtocol` reads the unpatched min/max interval from `IOptionsMonitor<RaProtocolOptions>.CurrentValue` (the same mechanism `GetCore`/`GetRa` use). One read per PATCH, so both fields come from one version. - `Startup/DhcpServiceRegistration.cs`: `Dhcpv4RelayOptions` is now bound when the relay is off too (the opposite branch of `AddNinlilDhcpv4Relay`, so no double registration), so a saved relay setting reaches the monitor in the default setup. `GET relay` with the relay off now shows the stored values instead of compiled defaults. No validation of these options runs at startup, so an unused invalid value cannot stop a start. - Traced (verifier): the PATCH writes the default `appsettings.json`, which the host loads with reload-on-change, and both options are bound with `Configure<T>(section)`, so saved values reach `CurrentValue` before a restart. A custom `RuntimeSettings:ConfigurationFilePath` is not watched (pre-existing, shared by the other live reads): filed as #314. - Other settings controllers' PATCH validations do not read startup `IOptions.Value`. Tests (`DhcpSettingsControllerLiveReadTests`, controller-level because the shared Web test host's settings file is not a configuration source): a remote ID that overflows the stored circuit ID is refused, one that fits it is accepted although the startup circuit ID would refuse it, and the same pair for the RA min/max ratio; all 4 fail with the startup reads put back. Web.Tests 2085 (without Docker, OpenAPI snapshot unchanged), Relay.Tests 36; build 0 warnings; csharpier clean. Closes #62 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Saving the DHCP relay card checks the circuit and remote IDs against the stored settings, not the startup values
Some checks failed
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Has been skipped
Build / Build Binary (linux-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (pull_request) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (pull_request) Has been skipped
Build / Smoke Test the Windows Binary (pull_request) Has been skipped
Build / Build Arch Linux Packages (pull_request) Has been skipped
Build / Build and Push Image (pull_request) Has been skipped
Build / Build and Test Deb and RPM Packages (pull_request) Has been skipped
Build / Publish Release (pull_request) Has been skipped
Build / Pipeline (pull_request) Failing after 0s
Build / Test .NET (push) Failing after 8m56s
Build / Pack and Push NuGet Packages (common) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Stage Draft Release (push) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (push) Has been skipped
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
0f5ad6a67d
The Router Advertisement protocol card checks a patched interval against the stored other interval the same way.

Closes #62

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit c509d8638a into develop 2026-11-05 14:27:34 -05:00
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
lantea-one/ninlil!315
No description provided.