|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 373d9f173f910d547159917401c4b1f84af85736 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Mon, 8 Sep 2014 14:00:34 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] networkctl: show the network file applied to each link
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/network/networkctl.c | 7 +++++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index d6d2e1dd27..43258bb942 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/network/networkctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -294,7 +294,7 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_udev_device_unref_ struct udev_device *d = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
char devid[2 + DECIMAL_STR_MAX(int)];
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- _cleanup_free_ char *t = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ _cleanup_free_ char *t = NULL, *network = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const char *on_color_operational, *off_color_operational,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
*on_color_setup, *off_color_setup;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -396,11 +396,14 @@ static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
model = udev_device_get_property_value(d, "ID_MODEL");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ sd_network_link_get_network_file(ifindex, &network);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- printf(" Type: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf("Network File: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ " Type: %s\n"
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
" State: %s%s%s (%s%s%s)\n",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ strna(network),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
strna(t),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
on_color_operational, strna(operational_state), off_color_operational,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
on_color_setup, strna(setup_state), off_color_setup);
|