From da8961e06d120c3bebd8d4155a091a87b52696dd Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 19 Jul 2011 23:22:40 +0200 Subject: [PATCH] fixed P10_GLINE protocol violation (expiration has to be the relative time, not a timestamp) --- src/proto-p10.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/proto-p10.c b/src/proto-p10.c index 29bf7ac..00a5165 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -702,12 +702,16 @@ irc_introduce(const char *passwd) void irc_gline(struct server *srv, struct gline *gline) { + // GL [!][+|-|>|<] [] [] [] [:] + //expiration = relative time (seconds) + //lastmod = timestamp + //livetime = timestamp if (gline->lastmod) - putsock("%s " P10_GLINE " %s +%s %lu %lu %lu :%s", - self->numeric, (srv ? srv->numeric : "*"), gline->target, gline->expires, gline->lastmod, gline->lifetime, gline->reason); + putsock("%s " P10_GLINE " %s +%s %lu %lu %lu :%s", self->numeric, (srv ? srv->numeric : "*"), + gline->target, gline->expires-now, gline->lastmod, gline->lifetime, gline->reason); else - putsock("%s " P10_GLINE " %s +%s %lu :%s", - self->numeric, (srv ? srv->numeric : "*"), gline->target, gline->expires, gline->reason); + putsock("%s " P10_GLINE " %s +%s %lu :%s", self->numeric, (srv ? srv->numeric : "*"), + gline->target, gline->expires-now, gline->reason); } void -- 2.20.1