Skip to content

dhcp-server: T9202: add client identifier to DHCPv4 lease output - #5394

Open
allanice001 wants to merge 1 commit into
vyos:rollingfrom
allanice001:dhcp-lease-client-id
Open

dhcp-server: T9202: add client identifier to DHCPv4 lease output#5394
allanice001 wants to merge 1 commit into
vyos:rollingfrom
allanice001:dhcp-lease-client-id

Conversation

@allanice001

@allanice001 allanice001 commented Aug 12, 2026

Copy link
Copy Markdown

Change summary

kea_get_server_leases() copies the DHCPv6 DUID out of the lease Kea returns, but drops the DHCPv4 client identifier. show dhcp server leases therefore cannot show it, and neither can anything built on the op-mode API. Kea itself has the value — lease4-get-all returns client-id alongside hw-address.

Two lines put it in the lease dict and a column puts it on screen.

Why it matters. A DHCPv4 static-mapping can be matched on the client identifier rather than the MAC — static-mapping includes interface/duid.xml.i. Hosts running systemd-networkd send an RFC 4361 identifier, ff:<IAID>:<DUID>, rather than the traditional 01:<MAC>, and with no host-reservation-identifiers configured Kea matches a duid reservation against the DUID embedded in it:

reservation      {"hostname": "ember-u26", "duid": "00:02:00:00:ab:11:68:46:79:5a:ab:74:cd:25", ...}
host sends       client-id ff:b5:5e:67:ff:00:02:00:00:ab:11:68:46:79:5a:ab:74:cd:25
resulting lease  192.168.10.92 — the reserved address

So the value a reservation must carry is a substring of one the operator cannot see anywhere in the CLI. A static-mapping written with the wrong one is accepted by the CLI, rendered into the Kea configuration, and then silently never matches: the host keeps taking a dynamic address while show dhcp server static-mappings reports it as reserved. The only way to find the real value today is sudo and the lease file.

The two identifier styles are visible side by side once the column exists:

IP Address     MAC address        Hostname       Client ID
192.168.10.60  00:e0:4c:68:4e:0d  arya           01:00:e0:4c:68:4e:0d
192.168.10.91  52:54:00:e3:be:31  ember-u24      ff:b5:5e:67:ff:00:02:00:00:ab:11:f8:af:84:82:a0:58:c1:5d
192.168.10.92  52:54:00:e3:be:41  ember-u26      ff:b5:5e:67:ff:00:02:00:00:ab:11:68:46:79:5a:ab:74:cd:25
192.168.10.93  52:54:00:e3:be:51  ember-rocky10  01:52:54:00:e3:be:51

Two notes on the implementation:

  • Kea returns client-id already colon separated, so unlike the DHCPv6 duid it is not passed through _format_hex_string() — doing so would insert a second colon after every existing one.
  • The column is appended rather than inserted beside the MAC. That matches where DHCPv6 already puts its DUID and leaves the existing column order untouched for anything parsing the text output. client_id is also accepted as a sorted key, as duid already is for inet6.

Clients that send no option 61 get -, consistent with how hostname and mac are handled a few lines above.

Types of changes

  • New feature (non-breaking change which adds functionality)

Related Task(s)

Related PR(s)

How to test / Smoketest result

The patched kea_get_server_leases() and _get_formatted_server_leases() were loaded in-process on a 2026.08.05-0033-rolling device carrying 26 live DHCPv4 leases, against the real lease4-get-all control-socket output — no system files modified:

import importlib.util, sys, vyos
spec = importlib.util.spec_from_file_location('vyos.kea', '/tmp/kea.py')
m = importlib.util.module_from_spec(spec); sys.modules['vyos.kea'] = m
spec.loader.exec_module(m)

active = m.kea_get_active_config('4', None)
pools = m.kea_get_dhcp_pools(active, '4')
leases = m.kea_get_server_leases(active, '4', '', pools, [], None)

spec2 = importlib.util.spec_from_file_location('opdhcp', '/tmp/dhcp.py')
op = importlib.util.module_from_spec(spec2); sys.argv = ['dhcp.py']
spec2.loader.exec_module(op)
print(op._get_formatted_server_leases(leases, family='inet'))
IP Address      MAC address        State     Lease start          Lease expiration     Remaining    Pool    Hostname           Origin    Client ID
--------------  -----------------  --------  -------------------  -------------------  -----------  ------  -----------------  --------  --------------------------------------------------------
192.168.10.60   00:e0:4c:68:4e:0d  active    2026-08-12 12:45:55  2026-08-13 12:45:55  22:30:43     LAN     arya               local     01:00:e0:4c:68:4e:0d
192.168.10.91   52:54:00:e3:be:31  active    2026-08-12 04:49:59  2026-08-13 04:49:59  14:34:47     LAN     ember-u24          local     ff:b5:5e:67:ff:00:02:00:00:ab:11:f8:af:84:82:a0:58:c1:5d
192.168.10.92   52:54:00:e3:be:41  active    2026-08-12 05:36:15  2026-08-13 05:36:15  15:21:03     LAN     ember-u26          local     ff:b5:5e:67:ff:00:02:00:00:ab:11:68:46:79:5a:ab:74:cd:25
192.168.10.93   52:54:00:e3:be:51  active    2026-08-12 02:45:56  2026-08-13 02:45:56  12:30:44     LAN     ember-rocky10      local     01:52:54:00:e3:be:51
192.168.10.94   52:54:00:e3:be:61  active    2026-08-12 02:45:55  2026-08-13 02:45:55  12:30:43     LAN     ember-f43          local     01:52:54:00:e3:be:61

Both identifier forms render, and the DHCPv6 path is untouched — the change is inside if inet == '4'.

ruff format (line-length 88, single quotes) reports no change to any line this PR touches.

Smoketest

test_service_dhcp-server.py, on a throwaway 1.5-rolling-202608071457 VM with this change applied:

$ sudo /usr/libexec/vyos/tests/smoke/cli/test_service_dhcp-server.py
test_dhcp_client_class (__main__.TestServiceDHCPServer.test_dhcp_client_class) ... ok
test_dhcp_dynamic_dns_update (__main__.TestServiceDHCPServer.test_dhcp_dynamic_dns_update) ... ok
test_dhcp_exclude_in_range (__main__.TestServiceDHCPServer.test_dhcp_exclude_in_range) ... ok
test_dhcp_exclude_not_in_range (__main__.TestServiceDHCPServer.test_dhcp_exclude_not_in_range) ... ok
test_dhcp_high_availability (__main__.TestServiceDHCPServer.test_dhcp_high_availability) ... ok
test_dhcp_high_availability_standby (__main__.TestServiceDHCPServer.test_dhcp_high_availability_standby) ... ok
test_dhcp_hostsd_lease_sync (__main__.TestServiceDHCPServer.test_dhcp_hostsd_lease_sync) ... ok
test_dhcp_log_level (__main__.TestServiceDHCPServer.test_dhcp_log_level) ... ok
test_dhcp_multiple_pools (__main__.TestServiceDHCPServer.test_dhcp_multiple_pools) ... ok
test_dhcp_on_interface_with_vrf (__main__.TestServiceDHCPServer.test_dhcp_on_interface_with_vrf) ... ok
test_dhcp_relay_server (__main__.TestServiceDHCPServer.test_dhcp_relay_server) ... ok
test_dhcp_single_pool_options (__main__.TestServiceDHCPServer.test_dhcp_single_pool_options) ... ok
test_dhcp_single_pool_options_scoped (__main__.TestServiceDHCPServer.test_dhcp_single_pool_options_scoped) ... ok
test_dhcp_single_pool_range (__main__.TestServiceDHCPServer.test_dhcp_single_pool_range) ... ok
test_dhcp_single_pool_static_mapping (__main__.TestServiceDHCPServer.test_dhcp_single_pool_static_mapping) ... ok
test_dhcp_vendor_option_ubiquiti (__main__.TestServiceDHCPServer.test_dhcp_vendor_option_ubiquiti) ... ok

----------------------------------------------------------------------
Ran 16 tests in 88.687s

OK

Worth being precise about what that does and does not show. The suite never calls kea_get_server_leases() — it exercises configuration generation, not op-mode output — so it is a regression check on the path that imports vyos.kea, not evidence for the feature. The evidence for the feature is the live lease output above.

Checklist

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable — test_service_dhcp-server.py, 16 tests, OK. See above.
  • I have thoroughly reviewed, understood, and tested the code contained in the PR, including any code produced by GenAI tools
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly — docs: T9202: document the DHCPv4 lease Client ID column vyos-documentation#2198

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d8fa6f99-d66c-4b6e-b035-3989bc1661c4

📥 Commits

Reviewing files that changed from the base of the PR and between ff22985 and b16f604.

📒 Files selected for processing (1)
  • python/vyos/kea.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • ansible/ansible (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • python/vyos/kea.py
📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🧰 Additional context used
🔍 Remote MCP vyos.dev

Additional review context

  • T9202 — “DHCPv4 lease output omits the client identifier” is Open, classified as a Feature, with Requires assessment priority. Its stated target includes VyOS 1.4 and 1.5.
  • The task explicitly requires:
    • Preserving Kea’s colon-separated client-id unchanged.
    • Returning - when the identifier is absent.
    • Appending the Client ID column without moving existing columns.
    • Supporting client_id sorting.
    • Leaving DHCPv6 behavior unchanged.
  • The task identifies both 01:<MAC> and RFC 4361 ff:<IAID>:<DUID> formats as relevant examples, so both should remain intact through parsing and display.
  • Compatibility is described as additive, but scripts that read the last table column positionally will now receive Client ID instead of Origin; appending the column avoids shifting earlier columns.
  • The only task comment links to PR vyos/vyos-1x#5394; no additional requirements are recorded.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • DHCPv4 lease listings now display each client’s ID.
    • Added a dedicated Client ID column to formatted IPv4 lease output.
    • Lease results can now be sorted by client ID across standard, pool, state-filtered, and VRF views.
    • Client ID sorting is available through command completion.
  • Bug Fixes

    • Client IDs retain Kea’s original formatting.
    • Missing client IDs are shown as -.

Walkthrough

DHCPv4 lease output now includes Kea client IDs. IPv4 lease formatting displays a Client ID column, and lease sorting accepts client_id across standard and VRF commands.

Changes

DHCPv4 client ID

Layer / File(s) Summary
Extract client IDs from Kea
python/vyos/kea.py
DHCPv4 lease output uses Kea’s colon-separated client-id value. Missing or empty values use -.
Display and sort client IDs
src/op_mode/dhcp.py, op-mode-definitions/dhcp.xml.in
IPv4 lease sorting accepts client_id. Formatted lease rows include the client ID, and command completion lists the sort key for standard and VRF lease commands.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding the DHCPv4 client identifier to lease output.
Description check ✅ Passed The description directly explains the implementation, rationale, testing, fallback behavior, and affected DHCPv4 lease output.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/vyos/kea.py`:
- Around line 686-690: Update the client identifier assignment in the DHCPv4
lease handling to use '-' whenever lease.get('client-id') is missing, empty, or
None, while preserving non-empty Kea-provided identifiers unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: c626ec32-2587-40e7-99e4-cc2dcfd96dbf

📥 Commits

Reviewing files that changed from the base of the PR and between ba8924d and 15c8f4b.

📒 Files selected for processing (2)
  • python/vyos/kea.py
  • src/op_mode/dhcp.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • ansible/ansible (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
⚠️ CI failures not shown inline (2)

GitHub Actions: CLA Check / 0_call-cla-assistant _ cla_assistant.txt: dhcp-server: T9202: add client identifier to DHCPv4 lease output

Conclusion: failure

View job details

##[group]Run contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08
 with:
   path-to-signatures: signatures/version1/cla.json
   path-to-document: https://github.com/vyos/vyos-cla-signatures/blob/production/README.md
   branch: production
   allowlist: github-actions[bot], dependabot-preview[bot], insights-engineering-bot, dependabot[bot], copilot, github-copilot[bot], copilot[bot], Copilot, vyosbot, pre-commit-ci, pre-commit-ci[bot], codecov, codecov[bot], mergify, mergify[bot], netlify, netlify[bot], claude, claude[bot], coderabbitai, coderabbitai[bot]
   remote-organization-name: vyos
   remote-repository-name: vyos-cla-signatures
   lock-pullrequest-aftermerge: false
   use-dco-flag: false
   suggest-recheck: true
 env:
   GITHUB_***REDACTED_SECRET_ASSIGNMENT***
   PERSONAL_ACCESS_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 CLA Assistant GitHub Action bot has started the process
 (node:2265) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
 (Use `node --trace-deprecation ...` to show where the warning was created)
 (node:2265) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
 ##[error]Committers of Pull Request number 5394 have to sign the CLA 📝

GitHub Actions: CLA Check / call-cla-assistant _ cla_assistant: dhcp-server: T9202: add client identifier to DHCPv4 lease output

Conclusion: failure

View job details

##[group]Run contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08
 with:
   path-to-signatures: signatures/version1/cla.json
   path-to-document: https://github.com/vyos/vyos-cla-signatures/blob/production/README.md
   branch: production
   allowlist: github-actions[bot], dependabot-preview[bot], insights-engineering-bot, dependabot[bot], copilot, github-copilot[bot], copilot[bot], Copilot, vyosbot, pre-commit-ci, pre-commit-ci[bot], codecov, codecov[bot], mergify, mergify[bot], netlify, netlify[bot], claude, claude[bot], coderabbitai, coderabbitai[bot]
   remote-organization-name: vyos
   remote-repository-name: vyos-cla-signatures
   lock-pullrequest-aftermerge: false
   use-dco-flag: false
   suggest-recheck: true
 env:
   GITHUB_***REDACTED_SECRET_ASSIGNMENT***
   PERSONAL_ACCESS_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 CLA Assistant GitHub Action bot has started the process
 (node:2265) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
 (Use `node --trace-deprecation ...` to show where the warning was created)
 (node:2265) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
 ##[error]Committers of Pull Request number 5394 have to sign the CLA 📝
🧰 Additional context used
📓 Path-based instructions (3)
python/vyos/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Python version must be >=3.11 for all code in the vyos.* library

Files:

  • python/vyos/kea.py
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use ruff 0.6.4 for Python linting with configuration in ruff.toml at repository root
Use pylint to check for W0611 (unused imports) violations in Python code
Use darker for code formatting in Python files
Use nose2 for Python testing with configuration in nose2.cfg at repository root

Files:

  • python/vyos/kea.py
  • src/op_mode/dhcp.py
src/op_mode/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Op-mode scripts must be located in src/op_mode/

Files:

  • src/op_mode/dhcp.py
🧠 Learnings (1)
📚 Learning: 2026-06-29T12:13:51.293Z
Learnt from: andamasov
Repo: vyos/vyos-1x PR: 5298
File: smoketest/scripts/cli/test_vpp.py:0-0
Timestamp: 2026-06-29T12:13:51.293Z
Learning: When reviewing vyos-1x code that parses or asserts VPP CLI output (e.g., smoketest CLI tests and VPP op-mode code), do not flag the token spelling "Forwrd" / "U-Forwrd" as a typo. It is intentionally preserved verbatim from the upstream VPP CLI text shown by commands like `vppctl show bridge-domain ... detail`. This misspelling is centrally allowlisted (vyos/.github#153) for that specific VPP-CLI context, so typo-review comments should exclude "Forwrd" when it originates from that VPP output.

Applied to files:

  • src/op_mode/dhcp.py
🔍 Remote MCP Context7, vyos.dev

Relevant review context

  • Broad VyOS search found task T9202, titled “DHCPv4 lease output omits the client identifier”. It is Open, a feature with Requires assessment priority, targeting both VyOS 1.4 and 1.5.
  • T9202 specifies the exact intended behavior: copy Kea’s client-id for DHCPv4, preserve its colon-separated representation, use - when absent, append a Client ID column, and add client_id sorting.
  • A related task shows Kea lease data can contain an empty client_id, confirming the missing-identifier fallback is a real case worth testing.
  • Kea documents lease4-get-all lease objects as containing a string client-id; its example uses the colon-separated format 01:00:0c:01:02:03:04.
  • T9202 has no comment history adding further requirements.
🔇 Additional comments (3)
src/op_mode/dhcp.py (3)

54-54: LGTM!


115-128: LGTM!


141-141: LGTM!

Comment thread python/vyos/kea.py Outdated
@allanice001

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

kea_get_server_leases() copies the DHCPv6 DUID out of the lease Kea
returns but drops the DHCPv4 client identifier, so `show dhcp server
leases` cannot show it and neither can anything built on the op-mode
API. Kea itself has it: lease4-get-all returns 'client-id' alongside
'hw-address'.

This matters wherever a reservation is matched on the client identifier
rather than the MAC. Hosts using systemd-networkd send an RFC 4361
identifier -- ff:<IAID>:<DUID> -- instead of the traditional 01:<MAC>,
and Kea matches a static-mapping 'duid' against the DUID embedded in it.
Without the identifier in the lease output there is no way to read the
value a reservation has to be written with, and a static-mapping
carrying the wrong one is accepted, rendered into the Kea configuration,
and silently never matches: the host keeps taking a dynamic address
while every screen reports it as reserved.

Kea returns client-id already colon separated, so unlike the DHCPv6 DUID
it is not passed through _format_hex_string().

  IP Address     MAC address        Hostname    Client ID
  192.168.10.60  00:e0:4c:68:4e:0d  arya        01:00:e0:4c:68:4e:0d
  192.168.10.40  52:54:00:32:6a:fa  ppp-server  ff:00:32:6a:fa:00:01:00:01:32:0d:2a:4c:52:54:00:32:6a:fa
  192.168.10.92  52:54:00:e3:be:41  ember-u26   ff:b5:5e:67:ff:00:02:00:00:ab:11:68:46:79:5a:ab:74:cd:25

The column is appended rather than inserted next to the MAC, matching
where DHCPv6 already puts its DUID and leaving the existing column order
untouched. 'client_id' is also accepted as a sort key and offered in the
completion list for the inet variants of 'show dhcp server leases sort'.

Signed-off-by: allanice001 <allanice001@gmail.com>
@allanice001
allanice001 force-pushed the dhcp-lease-client-id branch from ff22985 to b16f604 Compare August 12, 2026 15:24
@allanice001

Copy link
Copy Markdown
Author

Use - for empty client identifiers.

Taken, thanks — pushed.

For the record, since it affects how the fallback should be read: Kea does not appear to emit an empty client identifier. Lease4::toElement() only sets the key when client_id_ is populated, so the field is absent rather than empty, which is what a 27-lease sample on a 2026.08.05-0033-rolling device shows:

$ sudo python3 -c "
from vyos.kea import kea_get_leases
n_missing=n_empty=n_present=0
for l in kea_get_leases('4', None):
    if 'client-id' not in l: n_missing+=1
    elif not l['client-id']: n_empty+=1
    else: n_present+=1
print(f'key absent={n_missing} empty-string={n_empty} populated={n_present}')
"
key absent=7 empty-string=0 populated=20

So this is defensive rather than a fix for observed behaviour. Worth doing anyway: it costs nothing, it survives a future change on Kea's side, and or '-' is what hostname two lines above already uses.

@allanice001

Copy link
Copy Markdown
Author

Four workflows are sitting at action_required — first-contribution approval, which I can't clear from this side:

Perform CodeQL Analysis      :: action_required
Python Lint (Darker + Ruff)  :: action_required
Typos                        :: action_required
VyOS ISO Integration Test    :: action_required

No rush, and no obligation to approve on my account. To make that decision cheaper, I ran what I could locally against origin/rolling, using the same invocations the reusable workflow uses:

Darker — clean, no reformatting proposed.

$ darker -r origin/base --check --diff .
$ echo $?
0

Graylint / ruff — clean, no findings on changed lines.

$ graylint -L "ruff check" --revision origin/base .
$ echo $?
0

Typos — clean on the three files this PR touches.

$ typos python/vyos/kea.py src/op_mode/dhcp.py op-mode-definitions/dhcp.xml.in
$ echo $?
0

Unrelated to this PR, but noting it since I saw it: typos over the whole tree flags NAM in op-mode-definitions/show-log.xml.in:187 (an nftables chain abbreviation inside a journalctl --grep, so a false positive). Present on rolling already, untouched here.

ISO Integration Test — can't build an ISO here, but the part of it that covers this component was run directly, on a throwaway 1.5-rolling-202608071457 VM with this change applied:

$ sudo /usr/libexec/vyos/tests/smoke/cli/test_service_dhcp-server.py
...
Ran 16 tests in 88.687s

OK

CodeQL — not reproducible locally, and the least interesting of the four here: the change adds no new input handling, reading a field Kea already returns and placing it in an output table.

Happy to rebase or adjust anything if that helps.

@github-actions

Copy link
Copy Markdown

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • CLI Smoketests VPP 👍 passed
  • Config tests VPP 👍 passed
  • TPM tests 👍 passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds DHCPv4 client identifier visibility to the VyOS op-mode DHCP server lease output by propagating Kea’s client-id (Option 61) into the lease data model and rendering it as an additional column. This improves operational troubleshooting and enables operators to correctly match/verify static mappings that rely on client identifiers (e.g., RFC 4361-style IDs from systemd-networkd).

Changes:

  • Include Kea DHCPv4 client-id in the lease dict returned by kea_get_server_leases(), defaulting to - when absent.
  • Extend show dhcp server leases output (and sortable keys) to expose client_id and render a “Client ID” column.
  • Update op-mode CLI completion lists to include client_id as a valid sort key for DHCPv4 lease views.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/op_mode/dhcp.py Adds client_id as a sortable key and appends a “Client ID” column to DHCPv4 lease table output.
python/vyos/kea.py Copies Kea’s DHCPv4 client-id into the normalized lease dict (with - fallback).
op-mode-definitions/dhcp.xml.in Updates show dhcp server leases ... sort completion lists to include client_id for DHCPv4.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants