IPv6 support (hopefully with fewer future transition pains)
[ircu2.10.12-pk.git] / ircd / channel.c
index 6b038274eefd2c2350c5d68be89a10ca5fb2c8fa..885e787a00a6d37d763aff060d7b5a276917bf42 100644 (file)
@@ -174,12 +174,11 @@ static char *make_nick_user_host(char *namebuf, const char *nick,
  * Create a string of form "foo!bar@123.456.789.123" given foo, bar and the
  * IP-number as the parameters.  If NULL, they become "*".
  */
-#define NUI_BUFSIZE    (NICKLEN + USERLEN + 16 + 3)
+#define NUI_BUFSIZE    (NICKLEN + USERLEN + SOCKIPLEN + 4)
 static char *make_nick_user_ip(char *ipbuf, char *nick, char *name,
-                              struct in_addr ip)
+                              const struct irc_in_addr *ip)
 {
-  ircd_snprintf(0, ipbuf, NUI_BUFSIZE, "%s!%s@%s", nick, name,
-               ircd_ntoa((const char*) &ip));
+  ircd_snprintf(0, ipbuf, NUI_BUFSIZE, "%s!%s@%s", nick, name, ircd_ntoa(ip));
   return ipbuf;
 }
 
@@ -480,7 +479,7 @@ static int is_banned(struct Client *cptr, struct Channel *chptr,
     if ((tmp->flags & CHFL_BAN_IPMASK)) {
       if (!ip_s)
         ip_s = make_nick_user_ip(nu_ip, cli_name(cptr),
-                                (cli_user(cptr))->username, cli_ip(cptr));
+                                (cli_user(cptr))->username, &cli_ip(cptr));
       if (match(tmp->value.ban.banstr, ip_s) == 0)
         break;
     }