Skip to content

Commit

Permalink
JSON: Show DHCP4 IAID
Browse files Browse the repository at this point in the history
  • Loading branch information
ssahani committed Jan 12, 2024
1 parent fae5ce0 commit 3dce08c
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/json/network-link-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ int json_fill_address(bool ipv4, Link *l, json_object *jn, json_object *jobj) {

int json_fill_one_link(IfNameIndex *p, bool ipv4, json_object *jn, json_object **ret) {
_auto_cleanup_ char *setup_state = NULL, *tz = NULL, *network = NULL, *dhcp4_duid_type = NULL,
*dhcp6_duid_type = NULL, *dhcp4_duid_data = NULL, *dhcp6_duid_data = NULL;
*dhcp6_duid_type = NULL, *dhcp4_duid_data = NULL, *dhcp6_duid_data = NULL, *iaid = NULL;
_cleanup_(json_object_putp) json_object *jobj = NULL, *jdns = NULL, *jntp = NULL;
_cleanup_(addresses_freep) Addresses *addr = NULL;
_cleanup_(routes_freep) Routes *route = NULL;
Expand Down Expand Up @@ -1742,6 +1742,29 @@ int json_fill_one_link(IfNameIndex *p, bool ipv4, json_object *jn, json_object
steal_ptr(js);
}

r = manager_acquire_link_dhcp_client_iaid(p, DHCP_CLIENT_IPV4, &iaid);
if (r >= 0) {
_cleanup_(json_object_putp) json_object *js = NULL;

js = json_object_new_string(iaid);
if (!js)
return log_oom();

json_object_object_add(jobj, "DHCPv4IAID", js);
steal_ptr(js);
}

r = manager_acquire_link_dhcp_client_iaid(p, DHCP_CLIENT_IPV6, &iaid);
if (r >= 0) {
_cleanup_(json_object_putp) json_object *js = NULL;

js = json_object_new_string(iaid);
if (!js)
return log_oom();

json_object_object_add(jobj, "DHCPv6IAID", js);
steal_ptr(js);
}

r = manager_acquire_link_dhcp_client_duid(p, DHCP_CLIENT_IPV4, &dhcp4_duid_type, &dhcp4_duid_data);
if (r >= 0) {
Expand Down

0 comments on commit 3dce08c

Please sign in to comment.