summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-08 14:00:34 +0200
committerTom Gundersen <teg@jklm.no>2014-09-08 15:09:07 +0200
commit373d9f173f910d547159917401c4b1f84af85736 (patch)
treebd09d0b10d2d51e1026a92552e96038e92489fae /src
parentadc5b2e2ebcb91ee18b6a32681b8ec1e52793473 (diff)
networkctl: show the network file applied to each link
Diffstat (limited to 'src')
-rw-r--r--src/network/networkctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index d6d2e1dd27..43258bb942 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -294,7 +294,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL;
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
char devid[2 + DECIMAL_STR_MAX(int)];
- _cleanup_free_ char *t = NULL;
+ _cleanup_free_ char *t = NULL, *network = NULL;
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL;
const char *on_color_operational, *off_color_operational,
*on_color_setup, *off_color_setup;
@@ -396,11 +396,14 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
model = udev_device_get_property_value(d, "ID_MODEL");
}
+ sd_network_link_get_network_file(ifindex, &network);
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
- printf(" Type: %s\n"
+ printf("Network File: %s\n"
+ " Type: %s\n"
" State: %s%s%s (%s%s%s)\n",
+ strna(network),
strna(t),
on_color_operational, strna(operational_state), off_color_operational,
on_color_setup, strna(setup_state), off_color_setup);