IPv6 support (hopefully with fewer future transition pains)
[ircu2.10.12-pk.git] / ircd / s_serv.c
index 5ed58e40239e0bc17b686321eeb45839705798df..72d7be03e2d5b5453b67f2f95a2f628931cc3928 100644 (file)
@@ -35,7 +35,7 @@
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "ircd_snprintf.h"
-#include "ircd_xopen.h"
+#include "ircd_crypt.h"
 #include "jupe.h"
 #include "list.h"
 #include "match.h"
@@ -120,7 +120,7 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf)
      * XXX - if this comes from a server port, it will not have been added
      * to the IP check registry, see add_connection in s_bsd.c
      */
-    IPcheck_connect_fail(cli_ip(cptr));
+    IPcheck_connect_fail(&cli_ip(cptr));
   }
 
   det_confs_butmask(cptr, CONF_LEAF | CONF_HUB | CONF_SERVER | CONF_UWORLD);
@@ -181,6 +181,13 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf)
                  cli_info(cptr));
   }
 
+  /* Send these as early as possible so that glined users/juped servers can
+   * be removed from the network while the remote server is still chewing
+   * our burst.
+   */
+  gline_burst(cptr);
+  jupe_burst(cptr);
+
   /*
    * Pass on my client information to the new server
    *
@@ -226,14 +233,14 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf)
       continue;
     if (IsUser(acptr))
     {
-      char xxx_buf[8];
+      char xxx_buf[25];
       char *s = umode_str(acptr);
       sendcmdto_one(cli_user(acptr)->server, CMD_NICK, cptr,
                    "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
                    cli_name(acptr), cli_hopcount(acptr) + 1, cli_lastnick(acptr),
                    cli_user(acptr)->username, cli_user(acptr)->realhost,
                    *s ? "+" : "", s, *s ? " " : "",
-                   inttobase64(xxx_buf, ntohl(cli_ip(acptr).s_addr), 6),
+                   iptobase64(xxx_buf, &cli_ip(acptr), sizeof(xxx_buf)),
                    NumNick(acptr), cli_info(acptr));
     }
   }
@@ -246,8 +253,6 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf)
     for (chptr = GlobalChannelList; chptr; chptr = chptr->next)
       send_channel_modes(cptr, chptr);
   }
-  jupe_burst(cptr);
-  gline_burst(cptr);
   sendcmdto_one(&me, CMD_END_OF_BURST, cptr, "");
   return 0;
 }