#include "interface.h"
struct uci_context *uci_ctx;
+bool config_init = false;
static void config_parse_interface(struct uci_section *s)
{
return;
}
+ config_init = true;
uci_foreach_element(&p->sections, e) {
struct uci_section *s = uci_to_section(e);
if (!strcmp(s->type, "interface"))
config_parse_interface(s);
}
+ config_init = false;
+
+ start_pending_interfaces();
}
iface->active = new_state;
if (new_state) {
- if (iface->autostart)
+ if (iface->autostart && !config_init)
set_interface_up(iface);
} else
__set_interface_down(iface, true);
return 0;
}
+
+void
+start_pending_interfaces(void)
+{
+ struct interface *iface;
+
+ list_for_each_entry(iface, &interfaces, list) {
+ if (iface->active && iface->autostart)
+ set_interface_up(iface);
+ }
+}
int interface_attach_bridge(struct interface *iface, struct uci_section *s);
+void start_pending_interfaces(void);
+
#endif
struct interface;
extern struct uci_context *uci_ctx;
+extern bool config_init;
void config_init_interfaces(const char *name);