Index: lib/vlog.c =================================================================== --- lib/vlog.c.orig +++ lib/vlog.c @@ -273,7 +273,7 @@ set_destination_level(enum vlog_destinat ovs_mutex_lock(&log_file_mutex); if (!module) { struct vlog_module *mp; - LIST_FOR_EACH (mp, list, &vlog_modules) { + LIST_FOR_EACH_CHECK (mp, list, &vlog_modules) { mp->levels[destination] = level; update_min_level(mp); } @@ -397,7 +397,7 @@ vlog_set_log_file(const char *file_name) log_writer = async_append_create(new_log_fd); } - LIST_FOR_EACH (mp, list, &vlog_modules) { + LIST_FOR_EACH_CHECK (mp, list, &vlog_modules) { update_min_level(mp); } ovs_mutex_unlock(&log_file_mutex); Index: lib/list.h =================================================================== --- lib/list.h.orig +++ lib/list.h @@ -271,4 +271,9 @@ list_is_short(const struct ovs_list *lis return list->next == list->prev; } +#define LIST_FOR_EACH_CHECK(ITER, MEMBER, LIST) \ + for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \ + &(ITER)->MEMBER != (LIST) && (ITER)->MEMBER.next != (ITER)->MEMBER.prev; \ + ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER)) + #endif /* list.h */