chiark / gitweb /
networkd: fix confusion from missing braces
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 8 Mar 2014 16:57:28 +0000 (11:57 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 8 Mar 2014 16:58:56 +0000 (11:58 -0500)
Fixup for 76800848f281c3 'networkd: link - degrade failed UP to warning'.

src/network/networkd-link.c

index 9fb8d9f..a97e347 100644 (file)
@@ -1056,16 +1056,14 @@ static int link_up_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
                 return 1;
 
         r = sd_rtnl_message_get_errno(m);
-        if (r < 0)
+        if (r >= 0)
+                link_update_flags(link, link->flags | IFF_UP);
+        else
                 log_struct_link(LOG_WARNING, link,
                                 "MESSAGE=%s: could not bring up interface: %s",
                                 link->ifname, strerror(-r),
                                 "ERRNO=%d", -r,
                                 NULL);
-                return 1;
-
-        link_update_flags(link, link->flags | IFF_UP);
-
         return 1;
 }