X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fconfig.c;h=cac2d0920ea4b936311d57c999e6e1b34dcfc409;hp=05eb8248c99cafc2db1b84b04e286ca04c8303e6;hb=79d005edf35a363e2d254e37ca2edcd743c2b4f6;hpb=72fec39d4446d9bb9416763043c79d5135c84fbd diff --git a/src/config.c b/src/config.c index 05eb824..cac2d09 100644 --- a/src/config.c +++ b/src/config.c @@ -454,7 +454,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_RA_MANAGEMENT])) iface->managed = blobmsg_get_u32(c); - else + else if (overwrite) iface->managed = 1; if ((c = tb[IFACE_ATTR_RA_OFFLINK])) @@ -475,7 +475,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_NDPROXY_ROUTING])) iface->learn_routes = blobmsg_get_bool(c); - else + else if (overwrite) iface->learn_routes = true; if ((c = tb[IFACE_ATTR_NDPROXY_SLAVE])) @@ -517,8 +517,8 @@ static int set_interface(struct uci_section *s) void odhcpd_reload(void) { struct uci_context *uci = uci_alloc_context(); - struct lease *l; - list_for_each_entry(l, &leases, head) { + while (!list_empty(&leases)) { + struct lease *l = list_first_entry(&leases, struct lease, head); list_del(&l->head); free(l->duid); free(l);