chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
path-util: fix path_is_mount_point() for symlinks
[elogind.git]
/
src
/
network
/
networkctl.c
diff --git
a/src/network/networkctl.c
b/src/network/networkctl.c
index aa83f32f5371d7ed35b5e0387a1bfd5271e33fad..3a6faa273d14c4012ba090aa5db04a65041c18de 100644
(file)
--- a/
src/network/networkctl.c
+++ b/
src/network/networkctl.c
@@
-508,6
+508,8
@@
static int link_status_one(
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
const char *on_color_operational, *off_color_operational,
*on_color_setup, *off_color_setup;
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
const char *on_color_operational, *off_color_operational,
*on_color_setup, *off_color_setup;
+ _cleanup_strv_free_ char **carrier_bound_to = NULL;
+ _cleanup_strv_free_ char **carrier_bound_by = NULL;
struct ether_addr e;
unsigned iftype;
int r, ifindex;
struct ether_addr e;
unsigned iftype;
int r, ifindex;
@@
-606,12
+608,15
@@
static int link_status_one(
sd_network_link_get_network_file(ifindex, &network);
sd_network_link_get_network_file(ifindex, &network);
+ sd_network_link_get_carrier_bound_to(ifindex, &carrier_bound_to);
+ sd_network_link_get_carrier_bound_by(ifindex, &carrier_bound_by);
+
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
printf("%s%s%s %i: %s\n", on_color_operational, draw_special_char(DRAW_BLACK_CIRCLE), off_color_operational, ifindex, name);
- printf(" Link File: %s\n"
- "Network File: %s\n"
- " Type: %s\n"
- " State: %s%s%s (%s%s%s)\n",
+ printf("
Link File: %s\n"
+ "
Network File: %s\n"
+ "
Type: %s\n"
+ "
State: %s%s%s (%s%s%s)\n",
strna(link),
strna(network),
strna(t),
strna(link),
strna(network),
strna(t),
@@
-619,13
+624,13
@@
static int link_status_one(
on_color_setup, strna(setup_state), off_color_setup);
if (path)
on_color_setup, strna(setup_state), off_color_setup);
if (path)
- printf(" Path: %s\n", path);
+ printf("
Path: %s\n", path);
if (driver)
if (driver)
- printf(" Driver: %s\n", driver);
+ printf("
Driver: %s\n", driver);
if (vendor)
if (vendor)
- printf(" Vendor: %s\n", vendor);
+ printf("
Vendor: %s\n", vendor);
if (model)
if (model)
- printf(" Model: %s\n", model);
+ printf("
Model: %s\n", model);
if (have_mac) {
_cleanup_free_ char *description = NULL;
if (have_mac) {
_cleanup_free_ char *description = NULL;
@@
-634,23
+639,29
@@
static int link_status_one(
ieee_oui(hwdb, &e, &description);
if (description)
ieee_oui(hwdb, &e, &description);
if (description)
- printf(" HW Address: %s (%s)\n", ether_addr_to_string(&e, ea), description);
+ printf("
HW Address: %s (%s)\n", ether_addr_to_string(&e, ea), description);
else
else
- printf(" HW Address: %s\n", ether_addr_to_string(&e, ea));
+ printf("
HW Address: %s\n", ether_addr_to_string(&e, ea));
}
if (mtu > 0)
}
if (mtu > 0)
- printf(" MTU: %u\n", mtu);
+ printf("
MTU: %u\n", mtu);
- dump_addresses(rtnl, " Address: ", ifindex);
- dump_gateways(rtnl, hwdb, " Gateway: ", ifindex);
+ dump_addresses(rtnl, "
Address: ", ifindex);
+ dump_gateways(rtnl, hwdb, "
Gateway: ", ifindex);
if (!strv_isempty(dns))
if (!strv_isempty(dns))
- dump_list(" DNS: ", dns);
+ dump_list("
DNS: ", dns);
if (!strv_isempty(domains))
if (!strv_isempty(domains))
- dump_list(" Domain: ", domains);
+ dump_list("
Domain: ", domains);
if (!strv_isempty(ntp))
if (!strv_isempty(ntp))
- dump_list(" NTP: ", ntp);
+ dump_list(" NTP: ", ntp);
+
+ if (!strv_isempty(carrier_bound_to))
+ dump_list("Carrier Bound To: ", carrier_bound_to);
+
+ if (!strv_isempty(carrier_bound_by))
+ dump_list("Carrier Bound By: ", carrier_bound_by);
return 0;
}
return 0;
}
@@
-954,14
+965,14
@@
static int link_lldp_status(int argc, char *argv[], void *userdata) {
continue;
if (streq(a, "_Chassis")) {
continue;
if (streq(a, "_Chassis")) {
-
chassis = strdup(
b);
- if (
!chassis
)
- return
-ENOMEM
;
+
r = free_and_strdup(&chassis,
b);
+ if (
r < 0
)
+ return
r
;
} else if (streq(a, "_Port")) {
} else if (streq(a, "_Port")) {
-
port = strdup(
b);
- if (
!port
)
- return
-ENOMEM
;
+
r = free_and_strdup(&port,
b);
+ if (
r < 0
)
+ return
r
;
} else if (streq(a, "_TTL")) {
long long unsigned x;
} else if (streq(a, "_TTL")) {
long long unsigned x;