]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: make netlink callback not return negative value
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Oct 2018 05:34:00 +0000 (14:34 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 10 Oct 2018 05:43:05 +0000 (14:43 +0900)
Fixes #10320.

src/network/networkd-link.c

index ba15cac468d6b207bf0545ffd699382133a2d8f8..643a5e77c6a78e0a5fe22bd384c6726fbfef68db 100644 (file)
@@ -3024,9 +3024,7 @@ static int link_configure_duid(Link *link) {
         return 0;
 }
 
-static int link_initialized_and_synced(sd_netlink *rtnl, sd_netlink_message *m,
-                                       void *userdata) {
-        Link *link = userdata;
+static int link_initialized_and_synced(Link *link) {
         Network *network;
         int r;
 
@@ -3092,6 +3090,11 @@ static int link_initialized_and_synced(sd_netlink *rtnl, sd_netlink_message *m,
         return 1;
 }
 
+static int link_initialized_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) {
+        (void) link_initialized_and_synced(userdata);
+        return 1;
+}
+
 int link_initialized(Link *link, sd_device *device) {
         _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
         int r;
@@ -3121,8 +3124,7 @@ int link_initialized(Link *link, sd_device *device) {
         if (r < 0)
                 return r;
 
-        r = sd_netlink_call_async(link->manager->rtnl, req,
-                                  link_initialized_and_synced,
+        r = sd_netlink_call_async(link->manager->rtnl, req, link_initialized_handler,
                                   link_netlink_destroy_callback, link, 0, NULL);
         if (r < 0)
                 return r;
@@ -3369,7 +3371,7 @@ int link_add(Manager *m, sd_netlink_message *message, Link **ret) {
                 if (r < 0)
                         goto failed;
         } else {
-                r = link_initialized_and_synced(m->rtnl, NULL, link);
+                r = link_initialized_and_synced(link);
                 if (r < 0)
                         goto failed;
         }