summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2013-12-06 18:16:16 +0100
committerTom Gundersen <teg@jklm.no>2013-12-16 17:28:18 +0100
commitfc25d7f8050f262fa6cafeb2a1032e6eb3e7b412 (patch)
tree97369539c35eacfa87c33e859bea8f7acd267223 /src/network/networkd-link.c
parent23a7f0f721ff4e3b3fd4ed87f7d8e01ebad20093 (diff)
rtnl: simplify link_new()
Drop most of the arguments and instead introduce link_set_{flags,type}.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 8c7b0fc1ee..16255f9227 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -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));