summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-09-15 10:12:28 +0100
committerGitHub <noreply@github.com>2025-09-15 10:12:28 +0100
commit238a9006cc78022ba5e95258c1033ccf8abfb1af (patch)
tree21f504672a05f4bb1b8d2812a09b8a63b8570f7d /src
parentf406d48b527589200611dcbb5a99044489b1e9c5 (diff)
parent793c6a1ee7f9ae0bd335cd04ee5e153219bbc5e0 (diff)
downloadvyos-1x-238a9006cc78022ba5e95258c1033ccf8abfb1af.tar.gz
vyos-1x-238a9006cc78022ba5e95258c1033ccf8abfb1af.zip
Merge pull request #4289 from nvandamme/current
op-mode: T5992: show dhcpv6 leases with (mostly) the same fields as dhcp leases
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/dhcp.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py
index 4d6d092e6..03ad3268f 100755
--- a/src/op_mode/dhcp.py
+++ b/src/op_mode/dhcp.py
@@ -134,6 +134,7 @@ def _get_formatted_server_leases(raw_data, family='inet'):
if family == 'inet6':
for lease in raw_data:
ipaddr = lease.get('ip')
+ hw_addr = lease.get('mac')
state = lease.get('state')
start = datetime.fromtimestamp(
lease.get('last_communication'), timezone.utc
@@ -146,19 +147,22 @@ def _get_formatted_server_leases(raw_data, family='inet'):
remain = lease.get('remaining')
lease_type = lease.get('type')
pool = lease.get('pool')
+ hostname = lease.get('hostname')
host_identifier = lease.get('duid')
data_entries.append(
- [ipaddr, state, start, end, remain, lease_type, pool, host_identifier]
+ [ipaddr, hw_addr, state, start, end, remain, pool, hostname, lease_type, host_identifier]
)
headers = [
'IPv6 address',
+ 'MAC address',
'State',
'Last communication',
'Lease expiration',
'Remaining',
- 'Type',
'Pool',
+ 'Hostname',
+ 'Type',
'DUID',
]