git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1313
c9e4aea6-c8fd-4c43-8297-
357d70d61c8c
2005-02-18 Michael Poole <mdpoole@troilus.org>
2005-02-18 Michael Poole <mdpoole@troilus.org>
+ * ircd/IPcheck.c (ip_registry_find): Use canonical form of IP
+ address to look up and compare against hash entries.
+
+ * ircd/m_silence.c (forward_silences): When we reject a silence,
+ splice it out of the ban list. Warn the user if he is local.
+
* ircd/s_bsd.c (connect_inet): Set IP TOS for outbound server
connections.
* ircd/s_bsd.c (connect_inet): Set IP TOS for outbound server
connections.
ip_registry_canonicalize(&canon, ip);
entry = hashTable[ip_registry_hash(&canon)];
for ( ; entry; entry = entry->next) {
ip_registry_canonicalize(&canon, ip);
entry = hashTable[ip_registry_hash(&canon)];
for ( ; entry; entry = entry->next) {
- int bits = (ip->in6_16[0] == ntohs(0x2002)) ? 48 : 64;
- if (ipmask_check(ip, &entry->addr, bits))
+ int bits = (canon.in6_16[0] == htons(0x2002)) ? 48 : 64;
+ if (ipmask_check(&canon, &entry->addr, bits))
maxlength = maxsiles * feature_int(FEAT_AVBANLEN);
siles = totlength = 0;
/* Count number of current silences and their total length. */
maxlength = maxsiles * feature_int(FEAT_AVBANLEN);
siles = totlength = 0;
/* Count number of current silences and their total length. */
+ plast = &cli_user(sptr)->silence;
for (sile = cli_user(sptr)->silence; sile; sile = sile->next) {
if (sile->flags & (BAN_OVERLAPPED | BAN_ADD | BAN_DEL))
continue;
siles++;
totlength += strlen(sile->banstr);
for (sile = cli_user(sptr)->silence; sile; sile = sile->next) {
if (sile->flags & (BAN_OVERLAPPED | BAN_ADD | BAN_DEL))
continue;
siles++;
totlength += strlen(sile->banstr);
}
for (ii = jj = 0; ii < ac_count; ++ii) {
sile = accepted[ii];
}
for (ii = jj = 0; ii < ac_count; ++ii) {
sile = accepted[ii];
if (!(sile->flags & (BAN_OVERLAPPED | BAN_DEL))) {
slen = strlen(sile->banstr);
if ((siles >= maxsiles) || (totlength + slen >= maxlength)) {
if (!(sile->flags & (BAN_OVERLAPPED | BAN_DEL))) {
slen = strlen(sile->banstr);
if ((siles >= maxsiles) || (totlength + slen >= maxlength)) {
+ *plast = NULL;
+ if (MyUser(sptr))
+ send_reply(sptr, ERR_SILELISTFULL, accepted[ii]->banstr);
free_ban(accepted[ii]);
continue;
}
/* Update counts. */
siles++;
totlength += slen;
free_ban(accepted[ii]);
continue;
}
/* Update counts. */
siles++;
totlength += slen;
}
/* Store the update. */
accepted[jj++] = sile;
}
/* Store the update. */
accepted[jj++] = sile;