chiark / gitweb /
rtnl: replace message_append by typesafe versions
[elogind.git] / src / network / networkd-link.c
index 8c7b0fc1eeb8564008ddb782323fb0110c3e7e56..16255f9227aa7aab0abded0de5f67b1a5bceeff0 100644 (file)
@@ -264,7 +264,7 @@ static int link_get(Link *link) {
         assert(link->manager);
         assert(link->manager->rtnl);
 
-        r = sd_rtnl_message_link_new(RTM_GETLINK, link->ifindex, 0, 0, &req);
+        r = sd_rtnl_message_link_new(RTM_GETLINK, link->ifindex, &req);
         if (r < 0) {
                 log_error("Could not allocate RTM_GETLINK message");
                 return r;
@@ -301,12 +301,18 @@ static int link_up(Link *link) {
         assert(link->manager);
         assert(link->manager->rtnl);
 
-        r = sd_rtnl_message_link_new(RTM_NEWLINK, link->ifindex, 0, IFF_UP, &req);
+        r = sd_rtnl_message_link_new(RTM_NEWLINK, link->ifindex, &req);
         if (r < 0) {
                 log_error("Could not allocate RTM_NEWLINK message");
                 return r;
         }
 
+        r = sd_rtnl_message_link_set_flags(req, IFF_UP);
+        if (r < 0) {
+                log_error("Could not set link flags");
+                return r;
+        }
+
         r = sd_rtnl_call_async(link->manager->rtnl, req, link_up_handler, link, 0, NULL);
         if (r < 0) {
                 log_error("Could not send rtnetlink message: %s", strerror(-r));