When a plugin returns ULOGD_IRET_STOP, the propagation should
stop. This was not the case as break was used to do so but it was called
inside a switch and thus apply to the switch instruction and not to
the llist iteration.
Signed-off-by: Eric Leblond <eric@inl.fr>
void ulogd_propagate_results(struct ulogd_pluginstance *pi)
{
struct ulogd_pluginstance *cur = pi;
+ int abort_stack = 0;
/* iterate over remaining plugin stack */
llist_for_each_entry_continue(cur, &pi->stack->list, list) {
int ret;
/* fallthrough */
case ULOGD_IRET_STOP:
/* we shall abort further iteration of the stack */
+ abort_stack = 1;
break;
case ULOGD_IRET_OK:
/* we shall continue travelling down the stack */
ulogd_log(ULOGD_NOTICE,
"unknown return value `%d' from plugin %s\n",
ret, cur->plugin->name);
+ abort_stack = 1;
break;
}
+
+ if (abort_stack)
+ break;
}
ulogd_clean_results(pi);