move route interface assignment to the vlist update
[project/netifd.git] / system-linux.c
index 0e6ce5a..5b217cf 100644 (file)
@@ -243,10 +243,15 @@ handle_hotplug_event(struct uloop_fd *u, unsigned int events)
 
 static int system_rtnl_call(struct nl_msg *msg)
 {
-       int s = -(nl_send_auto_complete(sock_rtnl, msg)
-                       || nl_wait_for_ack(sock_rtnl));
+       int ret;
+
+       ret = nl_send_auto_complete(sock_rtnl, msg);
        nlmsg_free(msg);
-       return s;
+
+       if (ret < 0)
+               return ret;
+
+       return nl_wait_for_ack(sock_rtnl);
 }
 
 int system_bridge_delbr(struct device *bridge)
@@ -901,8 +906,7 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd)
        if (have_gw)
                nla_put(msg, RTA_GATEWAY, alen, &route->nexthop);
 
-       if (route->flags & DEVADDR_DEVICE)
-               nla_put_u32(msg, RTA_OIF, ifindex);
+       nla_put_u32(msg, RTA_OIF, ifindex);
 
        return system_rtnl_call(msg);
 }