clear errors before attempting to bring up an interface
authorFelix Fietkau <nbd@openwrt.org>
Tue, 18 Oct 2011 13:30:54 +0000 (15:30 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 18 Oct 2011 13:30:54 +0000 (15:30 +0200)
interface.c

index e0c2c78..9d6a7c1 100644 (file)
@@ -115,7 +115,6 @@ __interface_set_up(struct interface *iface)
        }
 
        return 0;
-
 }
 
 static void
@@ -363,14 +362,15 @@ interface_set_up(struct interface *iface)
 {
        iface->autostart = true;
 
+       if (iface->state != IFS_DOWN)
+               return 0;
+
+       interface_clear_errors(iface);
        if (!iface->available) {
                interface_add_error(iface, "interface", "NO_DEVICE", NULL, 0);
                return -1;
        }
 
-       if (iface->state != IFS_DOWN)
-               return 0;
-
        return __interface_set_up(iface);
 }