chiark / gitweb /
networkd: only track state of links we are managing
[elogind.git] / src / network / networkd-manager.c
index c48c0180ad074b8de7e03dcc458239c0c355da6b..07552063ecd50ea210fb28db067270cfbbfc3d1b 100644 (file)
@@ -134,7 +134,7 @@ static int manager_process_link(Manager *m, struct udev_device *device) {
         if (streq_ptr(udev_device_get_action(device), "remove")) {
                 uint64_t ifindex;
 
-                log_debug("Link removed: %s", udev_device_get_sysname(device));
+                log_debug("%s: link removed", udev_device_get_sysname(device));
 
                 ifindex = udev_device_get_ifindex(device);
                 link = hashmap_get(m->links, &ifindex);
@@ -143,7 +143,7 @@ static int manager_process_link(Manager *m, struct udev_device *device) {
 
                 link_free(link);
         } else {
-                log_debug("New link: %s", udev_device_get_sysname(device));
+                log_debug("%s: link added", udev_device_get_sysname(device));
 
                 r = link_add(m, device);
                 if (r < 0) {
@@ -247,9 +247,12 @@ static int manager_rtnl_process_link(sd_rtnl *rtnl, sd_rtnl_message *message, vo
         if (!link)
                 return 0;
 
-        r = link_update(link, message);
-        if (r < 0)
-                return 0;
+        /* only track the status of links we want to manage */
+        if (link->network) {
+                r = link_update(link, message);
+                if (r < 0)
+                        return 0;
+        }
 
         return 1;
 }