Skip to content

Commit 9d9398f

Browse files
jukkarfabiobaltieri
authored andcommitted
net: shell: iface: Add DHCPv6 status prints
It is useful to know the currect status of DHCPv6 client when printing the interface information. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent e459191 commit 9d9398f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

subsys/net/lib/shell/iface.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,29 @@ static void iface_cb(struct net_if *iface, void *user_data)
441441
PR("IPv6 retransmit timer : %d\n",
442442
ipv6->retrans_timer);
443443
}
444+
445+
#if defined(CONFIG_NET_DHCPV6)
446+
if (net_if_flag_is_set(iface, NET_IF_IPV6)) {
447+
PR("DHCPv6 renewal time (T1) : %llu ms\n",
448+
iface->config.dhcpv6.t1);
449+
PR("DHCPv6 rebind time (T2) : %llu ms\n",
450+
iface->config.dhcpv6.t2);
451+
PR("DHCPv6 expire time : %llu ms\n",
452+
iface->config.dhcpv6.expire);
453+
if (iface->config.dhcpv6.params.request_addr) {
454+
PR("DHCPv6 address : %s\n",
455+
net_sprint_ipv6_addr(&iface->config.dhcpv6.addr));
456+
}
457+
458+
if (iface->config.dhcpv6.params.request_prefix) {
459+
PR("DHCPv6 prefix : %s\n",
460+
net_sprint_ipv6_addr(&iface->config.dhcpv6.prefix));
461+
}
462+
463+
PR("DHCPv6 state : %s\n",
464+
net_dhcpv6_state_name(iface->config.dhcpv6.state));
465+
}
466+
#endif /* CONFIG_NET_DHCPV6 */
444467
#endif /* CONFIG_NET_IPV6 */
445468

446469
#if defined(CONFIG_NET_IPV4)

0 commit comments

Comments
 (0)