[systemd-commits] 2 commits - TODO src/network

Lennart Poettering lennart at kemper.freedesktop.org
Tue Aug 12 07:19:44 PDT 2014


 TODO                     |    7 -------
 src/network/networkctl.c |   38 ++++++++++++++++++++++++++------------
 2 files changed, 26 insertions(+), 19 deletions(-)

New commits:
commit f7d68aa8c9430dfddee5f913f93b405a5d75723a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 12 16:19:37 2014 +0200

    networkctl: make networkctl status without link name show all local IP addresses

diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 397a0d3..47e918d 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -396,14 +396,40 @@ static int link_status(char **args, unsigned n) {
         char **name;
         int r;
 
+        r = sd_rtnl_open(&rtnl, 0);
+        if (r < 0) {
+                log_error("Failed to connect to netlink: %s", strerror(-r));
+                return r;
+        }
+
+        udev = udev_new();
+        if (!udev) {
+                log_error("Failed to connect to udev: %m");
+                return -errno;
+        }
+
         if (n <= 1 && !arg_all) {
                 _cleanup_free_ char *operational_state = NULL;
                 _cleanup_strv_free_ char **dns = NULL, **ntp = NULL;
+                _cleanup_free_ struct local_address *addresses = NULL;
+                int i, c;
 
                 sd_network_get_operational_state(&operational_state);
                 if (operational_state)
                         printf("       State: %s\n", operational_state);
 
+                c = local_addresses(rtnl, 0, &addresses);
+                for (i = 0; i < c; i++) {
+                        _cleanup_free_ char *pretty = NULL;
+
+                        r = in_addr_to_string(addresses[i].family, &addresses[i].address, &pretty);
+                        if (r < 0)
+                                return log_oom();
+
+                        printf("%13s %s\n",
+                               i > 0 ? "" : "Address:", pretty);
+                }
+
                 sd_network_get_dns(&dns);
                 if (!strv_isempty(dns))
                         dump_list("         DNS: ", dns);
@@ -417,18 +443,6 @@ static int link_status(char **args, unsigned n) {
 
         pager_open_if_enabled();
 
-        r = sd_rtnl_open(&rtnl, 0);
-        if (r < 0) {
-                log_error("Failed to connect to netlink: %s", strerror(-r));
-                return r;
-        }
-
-        udev = udev_new();
-        if (!udev) {
-                log_error("Failed to connect to udev: %m");
-                return -errno;
-        }
-
         if (arg_all) {
                 _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL;
                 _cleanup_free_ LinkInfo *links = NULL;

commit 18af33753abc822ddf61aa37ff49368b7006fa79
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Aug 12 16:12:53 2014 +0200

    update TODO

diff --git a/TODO b/TODO
index f3ba55a..0bbee2f 100644
--- a/TODO
+++ b/TODO
@@ -24,10 +24,6 @@ External:
 
 Features:
 
-* libsystemd-network:
-  - I don't think there should be a client side object for dhcp
-    releases (probably not even a directory in /run for it)
-
 * networkd:
   - ipv4ll with multiple interfaces doesn't work when both dhcp and
     ipv4ll is used. for some reasons the kernel will currently pick an
@@ -42,9 +38,6 @@ Features:
     link but haven't acquired any yet. Just to inform the admin that
     networkd cares about an interface, but is still in progress..
 
-* networkctl:
-  - sort output of "networkctl list" and "networkctl status -a" by ifindex
-
 * resolved:
   - DNSSEC
         - use base64 for key presentation?



More information about the systemd-commits mailing list