summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-18 15:30:54 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-18 15:30:54 +0200
commit0ee52049c03987bc0fb068495d153ecf08f81dbb (patch)
tree352f14af7ebf11326cd08bbc90a053096e8a45fb /interface.c
parentcb9d7370302cb0ffc0c750e928f5413089cbca4c (diff)
clear errors before attempting to bring up an interface
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/interface.c b/interface.c
index e0c2c78..9d6a7c1 100644
--- a/interface.c
+++ b/interface.c
@@ -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);
}