From: Steven Barth Date: Tue, 15 Oct 2013 14:32:35 +0000 (+0200) Subject: Fix config retrieval from netifd X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=74cd69a0fe942e03429582f06969d26d478e54aa;p=oweals%2Fodhcpd.git Fix config retrieval from netifd --- diff --git a/src/config.c b/src/config.c index baa8579..e33c855 100644 --- a/src/config.c +++ b/src/config.c @@ -254,10 +254,10 @@ err: } -int config_parse_interface(struct blob_attr *b, const char *name, bool overwrite) +int config_parse_interface(void *data, size_t len, const char *name, bool overwrite) { struct blob_attr *tb[IFACE_ATTR_MAX], *c; - blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb, blob_data(b), blob_len(b)); + blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb, data, len); if (tb[IFACE_ATTR_INTERFACE]) name = blobmsg_get_string(tb[IFACE_ATTR_INTERFACE]); @@ -481,7 +481,7 @@ static int set_interface(struct uci_section *s) { blob_buf_init(&b, 0); uci_to_blob(&b, s, &interface_attr_list); - return config_parse_interface(b.head, s->e.name, true); + return config_parse_interface(blob_data(b.head), blob_len(b.head), s->e.name, true); } diff --git a/src/odhcpd.h b/src/odhcpd.h index 531a0ff..090b07b 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -186,7 +186,7 @@ time_t odhcpd_time(void); ssize_t odhcpd_unhexlify(uint8_t *dst, size_t len, const char *src); void odhcpd_hexlify(char *dst, const uint8_t *src, size_t len); -int config_parse_interface(struct blob_attr *b, const char *iname, bool overwrite); +int config_parse_interface(void *data, size_t len, const char *iname, bool overwrite); #ifdef WITH_UBUS int init_ubus(void); diff --git a/src/ubus.c b/src/ubus.c index bfa052e..55f52dc 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -248,7 +248,8 @@ void ubus_apply_network(void) continue; if (!c || !c->ignore) - config_parse_interface(tb[IFACE_ATTR_DATA], interface, false); + config_parse_interface(blobmsg_data(tb[IFACE_ATTR_DATA]), + blobmsg_data_len(tb[IFACE_ATTR_DATA]), interface, false); } } }