From 4a47689a35744ad45891d45b9e0422efb8004f93 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Wed, 16 Nov 2022 16:44:25 -0500 Subject: [PATCH] chmode: convert bants to a proper serial This way it increments for every change. It need not be a timestamp, as its actual value is not important. This fixes an issue where a ban could be set, hit, and cleared all in the same second, and the affected client would still be cached as banned because the bants hadn't actually changed. --- ircd/chmode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ircd/chmode.c b/ircd/chmode.c index c99f9506..21184d04 100644 --- a/ircd/chmode.c +++ b/ircd/chmode.c @@ -280,7 +280,7 @@ add_id(struct Client *source_p, struct Channel *chptr, const char *banid, const /* invalidate the can_send() cache */ if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION) - chptr->bants = rb_current_time(); + chptr->bants++; return actualBan; } @@ -310,7 +310,7 @@ del_id(struct Channel *chptr, const char *banid, rb_dlink_list * list, long mode /* invalidate the can_send() cache */ if(mode_type == CHFL_BAN || mode_type == CHFL_QUIET || mode_type == CHFL_EXCEPTION) - chptr->bants = rb_current_time(); + chptr->bants++; return banptr; }