summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkctl.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 93b1293457..d5d3c80a3c 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -216,14 +216,20 @@ static int link_status(char **args, unsigned n) {
if (n <= 1) {
_cleanup_free_ char *operational_state = NULL;
+ _cleanup_strv_free_ char **dns = NULL, **ntp = NULL;
- r = sd_network_get_operational_state(&operational_state);
- if (r < 0) {
- log_error("Failed to get operational state: %s", strerror(-r));
- return r;
- }
+ sd_network_get_operational_state(&operational_state);
+ if (operational_state)
+ printf(" State: %s\n", operational_state);
+
+ sd_network_get_dns(&dns);
+ if (!strv_isempty(dns))
+ dump_list(" DNS: ", dns);
+
+ sd_network_get_dns(&ntp);
+ if (!strv_isempty(ntp))
+ dump_list(" NTP: ", ntp);
- printf("State: %s\n", operational_state);
return 0;
}
@@ -312,7 +318,7 @@ static int link_status(char **args, unsigned n) {
sd_network_get_link_operational_state(canonical_ifindex, &operational_state);
sd_network_get_link_dns(canonical_ifindex, &dns);
- sd_network_get_link_dns(canonical_ifindex, &ntp);
+ sd_network_get_link_ntp(canonical_ifindex, &ntp);
sprintf(devid, "n%i", canonical_ifindex);
d = udev_device_new_from_device_id(udev, devid);