Commit 9b31cf33 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Don't reset the oc->ban pointer from BAN_CheckObject

Resetting the pointer would race against the ban lurker moving the OC
in the ban list and any object event listeners wanting to see the new
ban timestamp on OEV_BANCHG.

Fixes: #1863
parent d1b0f52e
......@@ -575,16 +575,14 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req)
VSC_C_main->bans_tested++;
VSC_C_main->bans_tests_tested += tests;
oc->ban->refcount--;
VTAILQ_REMOVE(&oc->ban->objcore, oc, ban_list);
if (b == bn) {
/* not banned */
oc->ban->refcount--;
VTAILQ_REMOVE(&oc->ban->objcore, oc, ban_list);
VTAILQ_INSERT_TAIL(&b0->objcore, oc, ban_list);
b0->refcount++;
oc->ban = b0;
b = NULL;
} else {
oc->ban = NULL;
}
if (VTAILQ_LAST(&ban_head, banhead_s)->refcount == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment