summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-03-20 11:18:02 +0100
committerSteven Barth <steven@midlink.org>2014-03-20 11:18:02 +0100
commit2e486ef14235777e5c71a6e15044637025d0770c (patch)
tree30575a9200bc0844d4af9315015632db33a1861f /src/ubus.c
parentd8cfeab6d37b470a33eeb0fac34934442f890f20 (diff)
ubus: use safe iterator
Diffstat (limited to 'src/ubus.c')
-rw-r--r--src/ubus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ubus.c b/src/ubus.c
index 47239fd..e2c310f 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -241,8 +241,8 @@ void ubus_apply_network(void)
blobmsg_get_string(tb[IFACE_ATTR_IFNAME]) : "";
bool matched = false;
- struct interface *c;
- list_for_each_entry(c, &interfaces, head) {
+ struct interface *c, *n;
+ list_for_each_entry_safe(c, n, &interfaces, head) {
char *f = memmem(c->upstream, c->upstream_len,
interface, strlen(interface) + 1);
bool cmatched = !strcmp(interface, c->name) || !strcmp(ifname, c->ifname);