chiark / gitweb /
rtnl: when querying local addresses and gateways, take address family into account
[elogind.git] / src / network / networkctl.c
index a76363006197026fff346b1d4beb59168af1c51b..6c5eb5b9362f5792612d89f2988e31bde49b12a8 100644 (file)
@@ -496,7 +496,7 @@ static int dump_addresses(sd_rtnl *rtnl, const char *prefix, int ifindex) {
         _cleanup_free_ struct local_address *local = NULL;
         int r, n, i;
 
-        n = local_addresses(rtnl, ifindex, &local);
+        n = local_addresses(rtnl, ifindex, AF_UNSPEC, &local);
         if (n < 0)
                 return n;
 
@@ -529,8 +529,7 @@ static void dump_list(const char *prefix, char **l) {
 
 static int link_status_one(sd_rtnl *rtnl, struct udev *udev, const char *name) {
         _cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **domains = NULL;
-        _cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *gateway = NULL, *gateway_description = NULL,
-                            *gateway6 = NULL, *gateway6_description = NULL;
+        _cleanup_free_ char *setup_state = NULL, *operational_state = NULL;
         _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL;
         _cleanup_udev_device_unref_ struct udev_device *d = NULL;
         _cleanup_udev_hwdb_unref_ struct udev_hwdb *hwdb = NULL;
@@ -709,7 +708,7 @@ static int link_status(char **args, unsigned n) {
 
                 printf("       State: %s%s%s\n", on_color_operational, strna(operational_state), off_color_operational);
 
-                c = local_addresses(rtnl, 0, &addresses);
+                c = local_addresses(rtnl, 0, AF_UNSPEC, &addresses);
                 for (i = 0; i < c; i++) {
                         _cleanup_free_ char *pretty = NULL;