X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=package%2Fswconfig%2Fsrc%2Fuci.c;h=e597acebfb7bd59b90bf51cbd1bb980888d20417;hb=65c8d28d39e590c291f7f40360a9ff2f930925de;hp=2df837d2787865b01ae5ff2d58f439a99d67e852;hpb=17a8f7b655ab85979781db15290784fcd3c496f2;p=openwrt-10.03%2F.git diff --git a/package/swconfig/src/uci.c b/package/swconfig/src/uci.c index 2df837d27..e597acebf 100644 --- a/package/swconfig/src/uci.c +++ b/package/swconfig/src/uci.c @@ -107,6 +107,7 @@ int swlib_apply_from_uci(struct switch_dev *dev, struct uci_package *p) struct uci_element *e; struct uci_section *s; struct uci_option *o; + struct uci_ptr ptr; struct switch_val val; int i; @@ -114,11 +115,28 @@ int swlib_apply_from_uci(struct switch_dev *dev, struct uci_package *p) head = &settings; uci_foreach_element(&p->sections, e) { + struct uci_element *n; + s = uci_to_section(e); if (strcmp(s->type, "switch") != 0) continue; + uci_foreach_element(&s->options, n) { + struct uci_option *o = uci_to_option(n); + + if (strcmp(n->name, "name") != 0) + continue; + + if (o->type != UCI_TYPE_STRING) + continue; + + if (!strcmp(o->v.string, dev->dev_name)) + goto found; + + break; + } + if (strcmp(e->name, dev->dev_name) != 0) continue;