X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=config.c;h=1e465c5be0702f8d601d44c85c7747a056069124;hp=18efe9692980dd08d963dd2e7af5d2f2a3effec9;hb=71016cda9739642fd49ffa949555e7240b7b1284;hpb=50eb00f20aaf86c84a24b8d2aaad13ffff52d3f1 diff --git a/config.c b/config.c index 18efe96..1e465c5 100644 --- a/config.c +++ b/config.c @@ -69,8 +69,8 @@ static void uci_array_to_blob(struct blob_buf *b, struct uci_option *o, free(str); } -static void uci_to_blob(struct blob_buf *b, struct uci_section *s, - const struct config_param_list *p) +static void __uci_to_blob(struct blob_buf *b, struct uci_section *s, + const struct config_param_list *p) { const struct blobmsg_policy *attr; struct uci_element *e; @@ -107,6 +107,16 @@ static void uci_to_blob(struct blob_buf *b, struct uci_section *s, } } +static void uci_to_blob(struct blob_buf *b, struct uci_section *s, + const struct config_param_list *p) +{ + int i; + + __uci_to_blob(b, s, p); + for (i = 0; i < p->n_next; i++) + uci_to_blob(b, s, p->next[i]); +} + static void config_parse_interface(struct uci_section *s) { @@ -114,7 +124,7 @@ config_parse_interface(struct uci_section *s) blob_buf_init(&b, 0); uci_to_blob(&b, s, &interface_attr_list); - alloc_interface(s->e.name, s, b.head); + interface_alloc(s->e.name, s, b.head); } void @@ -165,8 +175,8 @@ config_init_interfaces(const char *name) if (!strcmp(s->type, "interface")) config_parse_interface(s); } - cleanup_devices(); + device_free_all(); config_init = false; - start_pending_interfaces(); + interface_start_pending(); }