X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=ucimap.c;h=9aafe0b1cc8cca5f5c16fc9e7953d71c39284b1d;hb=afa566288588a590961c366476bcd9341a957297;hp=6d97b070c7c2a986d3237c20e4f06c0988142ab8;hpb=6c05c721c77c70f25c46fa20b5d5e4c817e8a651;p=uci.git diff --git a/ucimap.c b/ucimap.c index 6d97b07..9aafe0b 100644 --- a/ucimap.c +++ b/ucimap.c @@ -439,6 +439,14 @@ ucimap_check_optmap_type(struct uci_sectionmap *sm, struct uci_optmap *om) { unsigned int type; + if (unlikely(sm->type_name != om->type_name) && + unlikely(strcmp(sm->type_name, om->type_name) != 0)) { + DPRINTF("Option '%s' of section type '%s' refereces unknown " + "section type '%s', should be '%s'.\n", + om->name, sm->type, om->type_name, sm->type_name); + return false; + } + if (om->detected_type < 0) return true;