This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".
The branch, u2_10_12_branch has been updated
via 9995250e07b20b4de37ab29b61780d6e8ee47d89 (commit)
via 9c2d65985dae05054abecf2e8885c227c6a35d95 (commit)
via f4f79ff89e20b18251f2a6c9f59ab8e6574d873d (commit)
via e5ab5644264816245adb1e9a9498f773358c7bf9 (commit)
via 7ed1f0a10822e935cf3917ed78fced9ef4a706e1 (commit)
via 54e39a9ebf82b0186c9ee53eb43597fcb7c5a7b7 (commit)
via 92e9d3c41d20eafb9725560c49ea00d66fe3caba (commit)
from f4a821d94866ba46f7403c667e5cc07c840126f4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9995250e07b20b4de37ab29b61780d6e8ee47d89
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:52:22 2016 -0400
VERSION: Make server options string fixed-width.
Implements SF feature request #102.
diff --git a/ircd/s_debug.c b/ircd/s_debug.c
index 53338c2..06fd27a 100644
--- a/ircd/s_debug.c
+++ b/ircd/s_debug.c
@@ -78,41 +78,40 @@ const char* debug_serveropts(void)
bp = feature_int(FEAT_BUFFERPOOL);
if (bp < 1000000) {
AddC('b');
- if (bp > 99999)
- AddC((char)('0' + (bp / 100000)));
- if (bp > 9999)
- AddC((char)('0' + (bp / 10000) % 10));
+ AddC((char)('0' + (bp / 100000)));
+ AddC((char)('0' + (bp / 10000) % 10));
AddC((char)('0' + (bp / 1000) % 10));
} else {
AddC('B');
- if (bp > 99999999)
- AddC((char)('0' + (bp / 100000000)));
- if (bp > 9999999)
- AddC((char)('0' + (bp / 10000000) % 10));
+ AddC((char)('0' + (bp / 100000000)));
+ AddC((char)('0' + (bp / 10000000) % 10));
AddC((char)('0' + (bp / 1000000) % 10));
}
#ifndef NDEBUG
AddC('A');
+#else
+ AddC('-');
#endif
#ifdef DEBUGMODE
AddC('D');
+#else
+ AddC('-');
#endif
- if (feature_bool(FEAT_HUB))
- AddC('H');
-
- if (feature_bool(FEAT_IDLE_FROM_MSG))
- AddC('M');
-
- if (feature_bool(FEAT_RELIABLE_CLOCK))
- AddC('R');
+ AddC(feature_bool(FEAT_HUB) ? 'H' : '-');
+ AddC(feature_bool(FEAT_IDLE_FROM_MSG) ? 'M' : '-');
+ AddC(feature_bool(FEAT_RELIABLE_CLOCK) ? 'R' : '-');
#if defined(USE_POLL) && defined(HAVE_POLL_H)
AddC('U');
+#else
+ AddC('-');
#endif
#ifdef IPV6
AddC('6');
+#else
+ AddC('-');
#endif
serveropts[i] = '\0';
commit 9c2d65985dae05054abecf2e8885c227c6a35d95
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:43:30 2016 -0400
STATS g: Use extra parameter to filter G-line list.
Implements SF feature request #115.
diff --git a/ircd/gline.c b/ircd/gline.c
index 13b0cb1..0885f27 100644
--- a/ircd/gline.c
+++ b/ircd/gline.c
@@ -1156,7 +1156,7 @@ gline_list(struct Client *sptr, char *userhost)
/** Statistics callback to list G-lines.
* @param[in] sptr Client requesting statistics.
* @param[in] sd Stats descriptor for request (ignored).
- * @param[in] param Extra parameter from user (ignored).
+ * @param[in] param Mask to filter reported G-lines.
*/
void
gline_stats(struct Client *sptr, const struct StatDesc *sd,
@@ -1166,6 +1166,18 @@ gline_stats(struct Client *sptr, const struct StatDesc
*sd,
struct Gline *sgline;
gliter(GlobalGlineList, gline, sgline) {
+ if (param) {
+ char gl_mask[USERLEN+HOSTLEN+2];
+ strcpy(gl_mask, gline->gl_user);
+ if (gline->gl_host) {
+ size_t len = strlen(gl_mask);
+ gl_mask[len++] = '@';
+ strcpy(gl_mask + len, gline->gl_host);
+ }
+ if (mmatch(param, gl_mask))
+ continue;
+ }
+
send_reply(sptr, RPL_STATSGLINE, 'G', gline->gl_user,
gline->gl_host ? "@" : "",
gline->gl_host ? gline->gl_host : "",
diff --git a/ircd/s_stats.c b/ircd/s_stats.c
index d33108c..7007373 100644
--- a/ircd/s_stats.c
+++ b/ircd/s_stats.c
@@ -573,7 +573,7 @@ struct StatDesc statsinfo[] = {
{ 'F', "featuresall", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS),
FEAT_HIS_STATS_f,
feature_report, 1,
"All feature settings, including defaulted values." },
- { 'g', "glines", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_g,
+ { 'g', "glines", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_g,
gline_stats, 0,
"Global bans (G-lines)." },
{ 'i', "access", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_i,
commit f4f79ff89e20b18251f2a6c9f59ab8e6574d873d
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:33:34 2016 -0400
STATS y: Report default user mode too.
Implements SF feature request 116.
diff --git a/include/class.h b/include/class.h
index 5a9647d..5d77f0c 100644
--- a/include/class.h
+++ b/include/class.h
@@ -71,6 +71,8 @@ struct ConnectionClass {
#define MaxSendq(x) ((x)->max_sendq)
/** Get number of references to \a x. */
#define Links(x) ((x)->ref_count)
+/** Get default usermode for \a x. */
+#define CCUmode(x) ((x)->default_umode)
/** Get class name for ConfItem \a x. */
#define ConfClass(x) ((x)->conn_class->cc_name)
diff --git a/ircd/class.c b/ircd/class.c
index 2169605..72b1f9d 100644
--- a/ircd/class.c
+++ b/ircd/class.c
@@ -260,7 +260,8 @@ report_classes(struct Client *sptr, const struct StatDesc
*sd,
for (cltmp = connClassList; cltmp; cltmp = cltmp->next)
send_reply(sptr, RPL_STATSYLINE, (cltmp->valid ? 'Y' : 'y'),
ConClass(cltmp), PingFreq(cltmp), ConFreq(cltmp),
- MaxLinks(cltmp), MaxSendq(cltmp), Links(cltmp) - 1);
+ MaxLinks(cltmp), MaxSendq(cltmp), Links(cltmp) - 1,
+ CCUmode(cltmp) ? CCUmode(cltmp) : "+");
}
/** Return maximum SendQ length for a client.
diff --git a/ircd/s_err.c b/ircd/s_err.c
index ce660fb..f3527fb 100644
--- a/ircd/s_err.c
+++ b/ircd/s_err.c
@@ -468,7 +468,7 @@ static Numeric replyTable[] = {
/* 217 */
{ RPL_STATSPLINE, "P %d %d %s %s", "217" },
/* 218 */
- { RPL_STATSYLINE, "%c %s %d %d %u %u %u", "218" },
+ { RPL_STATSYLINE, "%c %s %d %d %u %u %u %s", "218" },
/* 219 */
{ RPL_ENDOFSTATS, "%s :End of /STATS report", "219" },
/* 220 */
commit e5ab5644264816245adb1e9a9498f773358c7bf9
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:21:19 2016 -0400
Add channel mode +C (no CTCPs except ACTION).
include/channel.h (MODE_NOCTCP): Define.
(infochanmodes): Add +C.
include/supported.h (FEATURESVALUES2): Add +C.
ircd/channel.c (channel_modes): Emit it.
(modebuf_flush_int): Likewise.
(modebuf_mode): Parse it.
(modebuf_extract): Likewise.
(mode_parse): Likewise.
ircd/ircd_relay.c (relay_channel_message): Bail when a message to a +C
channel that contains a CTCP but does not start with CTCP ACTION.
(relay_channel_notice): Likewise.
ircd/m_clearmode.c (do_clearmode): Clear mode +C on /clearmode.
diff --git a/include/channel.h b/include/channel.h
index 1993400..3865099 100644
--- a/include/channel.h
+++ b/include/channel.h
@@ -104,6 +104,7 @@ struct Client;
#define MODE_REGISTERED 0x2000 /**< Channel marked as registered
* (for future semantic expansion) */
#define MODE_NOCOLOR 0x4000 /**< +c No colors */
+#define MODE_NOCTCP 0x8000 /**< +C No CTCPs except ACTION */
#define MODE_SAVE 0x20000 /**< save this mode-with-arg 'til
* later */
#define MODE_FREE 0x40000 /**< string needs to be passed to
@@ -118,7 +119,7 @@ struct Client;
#define MODE_WPARAS
(MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT|MODE_APASS|MODE_UPASS)
/** Available Channel modes */
-#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrDdRc" :
"biklmnopstvrDdRc"
+#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrDdRcC" :
"biklmnopstvrDdRcC"
/** Available Channel modes that take parameters */
#define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "AbkloUv" :
"bklov"
diff --git a/include/supported.h b/include/supported.h
index cf4a89f..5f0aa91 100644
--- a/include/supported.h
+++ b/include/supported.h
@@ -65,7 +65,7 @@
#define FEATURESVALUES2 NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN, \
feature_int(FEAT_CHANNELLEN), CHANNELLEN, \
(feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#"),
"(ov)@+", "@+", \
- (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrDdRc" :
"b,k,l,imnpstrDdRc"), \
+ (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrDdRcC"
: "b,k,l,imnpstrDdRcC"), \
"rfc1459", feature_str(FEAT_NETWORK)
#endif /* INCLUDED_supported_h */
diff --git a/ircd/channel.c b/ircd/channel.c
index 24c93c4..bd7331d 100644
--- a/ircd/channel.c
+++ b/ircd/channel.c
@@ -836,6 +836,8 @@ void channel_modes(struct Client *cptr, char *mbuf, char
*pbuf, int buflen,
*mbuf++ = 'R';
if (chptr->mode.mode & MODE_NOCOLOR)
*mbuf++ = 'c';
+ if (chptr->mode.mode & MODE_NOCTCP)
+ *mbuf++ = 'C';
if (chptr->mode.limit) {
*mbuf++ = 'l';
ircd_snprintf(0, pbuf, buflen, "%u", chptr->mode.limit);
@@ -1532,6 +1534,7 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all)
MODE_DELJOINS, 'D',
MODE_REGISTERED, 'R',
MODE_NOCOLOR, 'c',
+ MODE_NOCTCP, 'C',
/* MODE_KEY, 'k', */
/* MODE_BAN, 'b', */
MODE_LIMIT, 'l',
@@ -1962,7 +1965,7 @@ modebuf_mode(struct ModeBuf *mbuf, unsigned int mode)
mode &= (MODE_ADD | MODE_DEL | MODE_PRIVATE | MODE_SECRET | MODE_MODERATED |
MODE_TOPICLIMIT | MODE_INVITEONLY | MODE_NOPRIVMSGS | MODE_REGONLY |
- MODE_NOCOLOR |
+ MODE_NOCOLOR | MODE_NOCTCP |
MODE_DELJOINS | MODE_WASDELJOINS | MODE_REGISTERED);
if (!(mode & ~(MODE_ADD | MODE_DEL))) /* don't add empty modes... */
@@ -2097,6 +2100,7 @@ modebuf_extract(struct ModeBuf *mbuf, char *buf)
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
MODE_NOCOLOR, 'c',
+ MODE_NOCTCP, 'C',
0x0, 0x0
};
unsigned int add;
@@ -3239,6 +3243,7 @@ mode_parse(struct ModeBuf *mbuf, struct Client *cptr,
struct Client *sptr,
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
MODE_NOCOLOR, 'c',
+ MODE_NOCTCP, 'C',
MODE_ADD, '+',
MODE_DEL, '-',
0x0, 0x0
diff --git a/ircd/ircd_relay.c b/ircd/ircd_relay.c
index de63d1c..3db9459 100644
--- a/ircd/ircd_relay.c
+++ b/ircd/ircd_relay.c
@@ -116,6 +116,15 @@ void relay_channel_message(struct Client* sptr, const
char* name, const char* te
}
}
+ if ((chptr->mode.mode & MODE_NOCTCP) && ircd_strncmp(text, "\001ACTION ",
8)) {
+ for (ch = text; *ch != '\0'; ++ch) {
+ if (*ch == 1) {
+ send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
+ return;
+ }
+ }
+ }
+
RevealDelayedJoinIfNeeded(sptr, chptr);
sendcmdto_channel_butone(sptr, CMD_PRIVATE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
@@ -157,6 +166,15 @@ void relay_channel_notice(struct Client* sptr, const char*
name, const char* tex
}
}
+ if ((chptr->mode.mode & MODE_NOCTCP) && ircd_strncmp(text, "\001ACTION ",
8)) {
+ for (ch = text; *ch != '\0'; ++ch) {
+ if (*ch == 1) {
+ send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
+ return;
+ }
+ }
+ }
+
RevealDelayedJoinIfNeeded(sptr, chptr);
sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
diff --git a/ircd/m_clearmode.c b/ircd/m_clearmode.c
index b3fbb9f..fdac788 100644
--- a/ircd/m_clearmode.c
+++ b/ircd/m_clearmode.c
@@ -125,6 +125,7 @@ do_clearmode(struct Client *cptr, struct Client *sptr,
struct Channel *chptr,
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
MODE_NOCOLOR, 'c',
+ MODE_NOCTCP, 'C',
0x0, 0x0
};
int *flag_p;
commit 7ed1f0a10822e935cf3917ed78fced9ef4a706e1
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:20:20 2016 -0400
Add channel mode +c (no colors).
include/channel.h (MODE_NOCOLOR): Define.
(infochanmodes): Add +c.
include/supported.h (FEATURESVALUES2): Add +c.
ircd/channel.c (channel_modes): Emit it.
(modebuf_flush_int): Likewise.
(modebuf_mode): Parse it.
(modebuf_extract): Likewise.
(mode_parse): Likewise.
ircd/ircd_relay.c (relay_channel_message): Bail when a message to a +c
channel contains mIRC color codes.
(relay_channel_notice): Likewise.
ircd/m_clearmode.c (do_clearmode): Clear mode +c on /clearmode.
diff --git a/include/channel.h b/include/channel.h
index cddaf8f..1993400 100644
--- a/include/channel.h
+++ b/include/channel.h
@@ -103,6 +103,7 @@ struct Client;
#define MODE_DELJOINS 0x1000 /**< New join messages are delayed */
#define MODE_REGISTERED 0x2000 /**< Channel marked as registered
* (for future semantic expansion) */
+#define MODE_NOCOLOR 0x4000 /**< +c No colors */
#define MODE_SAVE 0x20000 /**< save this mode-with-arg 'til
* later */
#define MODE_FREE 0x40000 /**< string needs to be passed to
@@ -117,7 +118,7 @@ struct Client;
#define MODE_WPARAS
(MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT|MODE_APASS|MODE_UPASS)
/** Available Channel modes */
-#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrDdR" :
"biklmnopstvrDdR"
+#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrDdRc" :
"biklmnopstvrDdRc"
/** Available Channel modes that take parameters */
#define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "AbkloUv" :
"bklov"
diff --git a/include/supported.h b/include/supported.h
index 9f3a089..cf4a89f 100644
--- a/include/supported.h
+++ b/include/supported.h
@@ -65,7 +65,7 @@
#define FEATURESVALUES2 NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN, \
feature_int(FEAT_CHANNELLEN), CHANNELLEN, \
(feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#"),
"(ov)@+", "@+", \
- (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrDdR" :
"b,k,l,imnpstrDdR"), \
+ (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrDdRc" :
"b,k,l,imnpstrDdRc"), \
"rfc1459", feature_str(FEAT_NETWORK)
#endif /* INCLUDED_supported_h */
diff --git a/ircd/channel.c b/ircd/channel.c
index 5762bbc..24c93c4 100644
--- a/ircd/channel.c
+++ b/ircd/channel.c
@@ -834,6 +834,8 @@ void channel_modes(struct Client *cptr, char *mbuf, char
*pbuf, int buflen,
*mbuf++ = 'd';
if (chptr->mode.mode & MODE_REGISTERED)
*mbuf++ = 'R';
+ if (chptr->mode.mode & MODE_NOCOLOR)
+ *mbuf++ = 'c';
if (chptr->mode.limit) {
*mbuf++ = 'l';
ircd_snprintf(0, pbuf, buflen, "%u", chptr->mode.limit);
@@ -1529,6 +1531,7 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all)
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
MODE_REGISTERED, 'R',
+ MODE_NOCOLOR, 'c',
/* MODE_KEY, 'k', */
/* MODE_BAN, 'b', */
MODE_LIMIT, 'l',
@@ -1959,6 +1962,7 @@ modebuf_mode(struct ModeBuf *mbuf, unsigned int mode)
mode &= (MODE_ADD | MODE_DEL | MODE_PRIVATE | MODE_SECRET | MODE_MODERATED |
MODE_TOPICLIMIT | MODE_INVITEONLY | MODE_NOPRIVMSGS | MODE_REGONLY |
+ MODE_NOCOLOR |
MODE_DELJOINS | MODE_WASDELJOINS | MODE_REGISTERED);
if (!(mode & ~(MODE_ADD | MODE_DEL))) /* don't add empty modes... */
@@ -2092,6 +2096,7 @@ modebuf_extract(struct ModeBuf *mbuf, char *buf)
MODE_LIMIT, 'l',
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
+ MODE_NOCOLOR, 'c',
0x0, 0x0
};
unsigned int add;
@@ -3233,6 +3238,7 @@ mode_parse(struct ModeBuf *mbuf, struct Client *cptr,
struct Client *sptr,
MODE_LIMIT, 'l',
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
+ MODE_NOCOLOR, 'c',
MODE_ADD, '+',
MODE_DEL, '-',
0x0, 0x0
diff --git a/ircd/ircd_relay.c b/ircd/ircd_relay.c
index b7a751d..de63d1c 100644
--- a/ircd/ircd_relay.c
+++ b/ircd/ircd_relay.c
@@ -86,6 +86,8 @@
void relay_channel_message(struct Client* sptr, const char* name, const char*
text)
{
struct Channel* chptr;
+ const char *ch;
+
assert(0 != sptr);
assert(0 != name);
assert(0 != text);
@@ -105,6 +107,15 @@ void relay_channel_message(struct Client* sptr, const
char* name, const char* te
check_target_limit(sptr, chptr, chptr->chname, 0))
return;
+ if (chptr->mode.mode & MODE_NOCOLOR) {
+ for (ch = text; *ch != '\0'; ++ch) {
+ if (*ch == 3 || *ch == 27) {
+ send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
+ return;
+ }
+ }
+ }
+
RevealDelayedJoinIfNeeded(sptr, chptr);
sendcmdto_channel_butone(sptr, CMD_PRIVATE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
@@ -119,6 +130,8 @@ void relay_channel_message(struct Client* sptr, const char*
name, const char* te
void relay_channel_notice(struct Client* sptr, const char* name, const char*
text)
{
struct Channel* chptr;
+ const char *ch;
+
assert(0 != sptr);
assert(0 != name);
assert(0 != text);
@@ -135,6 +148,15 @@ void relay_channel_notice(struct Client* sptr, const char*
name, const char* tex
check_target_limit(sptr, chptr, chptr->chname, 0))
return;
+ if (chptr->mode.mode & MODE_NOCOLOR) {
+ for (ch = text; *ch != '\0'; ++ch) {
+ if (*ch == 3 || *ch == 27) {
+ send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
+ return;
+ }
+ }
+ }
+
RevealDelayedJoinIfNeeded(sptr, chptr);
sendcmdto_channel_butone(sptr, CMD_NOTICE, chptr, cli_from(sptr),
SKIP_DEAF | SKIP_BURST, "%H :%s", chptr, text);
diff --git a/ircd/m_clearmode.c b/ircd/m_clearmode.c
index 81392da..b3fbb9f 100644
--- a/ircd/m_clearmode.c
+++ b/ircd/m_clearmode.c
@@ -124,6 +124,7 @@ do_clearmode(struct Client *cptr, struct Client *sptr,
struct Channel *chptr,
MODE_LIMIT, 'l',
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
+ MODE_NOCOLOR, 'c',
0x0, 0x0
};
int *flag_p;
commit 54e39a9ebf82b0186c9ee53eb43597fcb7c5a7b7
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:15:39 2016 -0400
gline: Expire very old, stale G-lines.
The lifetime may be 20 years in the future, but if they already expired
and nobody touched them recently, the lifetime is probably due to a bug.
diff --git a/ircd/gline.c b/ircd/gline.c
index 9c3d297..13b0cb1 100644
--- a/ircd/gline.c
+++ b/ircd/gline.c
@@ -63,6 +63,7 @@
#define MASK_WILDS 0x10 /**< Mask contains wildcards */
#define MASK_IP 0x20 /**< Mask is an IP address */
#define MASK_HALT 0x40 /**< Finished processing mask */
+#define ONE_MONTH (30 * 24 * 3600) /**< Number of seconds in 30 days */
/** List of user G-lines. */
struct Gline* GlobalGlineList = 0;
@@ -87,7 +88,9 @@ struct Gline* BadChanGlineList = 0;
/* Figure out the next pointer in list... */ \
if ((((next) = (gl)->gl_next) || 1) && \
/* Then see if it's expired */ \
- (gl)->gl_lifetime <= TStime()) \
+ (((gl)->gl_lifetime <= TStime()) || \
+ (((gl)->gl_expire < TStime() - ONE_MONTH) && \
+ ((gl)->gl_lastmod < TStime() - ONE_MONTH)))) \
/* Record has expired, so free the G-line */ \
gline_free((gl)); \
/* See if we need to expire the G-line */ \
commit 92e9d3c41d20eafb9725560c49ea00d66fe3caba
Author: Michael Poole <[email protected]>
Date: Sun Oct 23 23:11:18 2016 -0400
IPcheck: Use /64 prefixes for IPv6 addresses.
diff --git a/ircd/IPcheck.c b/ircd/IPcheck.c
index 67b3485..ec4d15c 100644
--- a/ircd/IPcheck.c
+++ b/ircd/IPcheck.c
@@ -77,8 +77,9 @@ static struct IPRegistryEntry* freeList;
static struct Timer expireTimer;
/** Convert IP addresses to canonical form for comparison. IPv4
- * addresses are translated into 6to4 form; IPv6 addresses are left
- * alone.
+ * addresses are translated into 6to4 form; IPv6 addresses are
+ * truncated to their /64 prefix.
+ *
* @param[out] out Receives canonical format for address.
* @param[in] in IP address to canonicalize.
*/
@@ -88,10 +89,16 @@ static void ip_registry_canonicalize(struct irc_in_addr
*out, const struct irc_i
out->in6_16[0] = htons(0x2002);
out->in6_16[1] = in->in6_16[6];
out->in6_16[2] = in->in6_16[7];
- out->in6_16[3] = out->in6_16[4] = out->in6_16[5] = 0;
- out->in6_16[6] = out->in6_16[7] = 0;
- } else
- memcpy(out, in, sizeof(*out));
+ out->in6_16[3] = 0;
+ } else {
+ out->in6_16[0] = in->in6_16[0];
+ out->in6_16[1] = in->in6_16[1];
+ out->in6_16[2] = in->in6_16[2];
+ out->in6_16[3] = in->in6_16[3];
+ }
+
+ out->in6_16[4] = out->in6_16[5] = 0;
+ out->in6_16[6] = out->in6_16[7] = 0;
}
/** Calculate hash value for an IP address.
-----------------------------------------------------------------------
Summary of changes:
include/channel.h | 4 +++-
include/class.h | 2 ++
include/supported.h | 2 +-
ircd/IPcheck.c | 19 +++++++++++++------
ircd/channel.c | 11 +++++++++++
ircd/class.c | 3 ++-
ircd/gline.c | 19 +++++++++++++++++--
ircd/ircd_relay.c | 40 ++++++++++++++++++++++++++++++++++++++++
ircd/m_clearmode.c | 2 ++
ircd/s_debug.c | 31 +++++++++++++++----------------
ircd/s_err.c | 2 +-
ircd/s_stats.c | 2 +-
12 files changed, 108 insertions(+), 29 deletions(-)
hooks/post-receive
--
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches