summaryrefslogtreecommitdiff
path: root/src/rtnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtnl.c')
-rw-r--r--src/rtnl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index 7da55fa5..7c8c68b8 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -591,14 +591,15 @@ static void process_newlink(unsigned short type, int index, unsigned flags,
__connman_technology_add_interface(interface->service_type,
interface->index, interface->ident);
- for (list = watch_list; list; list = list->next) {
+ list = watch_list;
+ while (list) {
+ GSList *next = list->next;
struct watch_data *watch = list->data;
- if (watch->index != index)
- continue;
-
- if (watch->newlink)
+ if (watch->index == index && watch->newlink)
watch->newlink(flags, change, watch->user_data);
+
+ list = next;
}
}