Author: Jean-Edouard Babin <Jeb@jeb.com.fr> (by way of Alex Badea <vampire@p16.pub...
[ircu2.10.12-pk.git] / ircd / m_server.c
index 2191a6c0b864677b6fd55a4cd3f2f31ac7e4bde7..c426132930b5ded5444fcf6f8e06fd865f9abf73 100644 (file)
@@ -85,6 +85,7 @@
 #include "hash.h"
 #include "ircd.h"
 #include "ircd_log.h"
+#include "ircd_policy.h"
 #include "ircd_features.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "s_serv.h"
 #include "send.h"
 #include "userload.h"
+#include "map.h"
 
 #include <assert.h>
 #include <stdlib.h>
@@ -129,7 +131,6 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   char             info[REALLEN + 1];
   char*            host;
   struct Client*   acptr;
-  struct Client*   bcptr;
   struct Client*   LHcptr = 0;
   struct ConfItem* aconf = 0;
   struct ConfItem* lhconf = 0;
@@ -150,7 +151,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   recv_time = TStime();
   info[0] = '\0';
 
-  if (parc < 7)
+  if (parc < 8)
   {
     need_more_params(sptr, "SERVER");
     return exit_client(cptr, cptr, &me, "Need more parameters");
@@ -638,6 +639,10 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   else
     ret = 0;
 
+#if defined(HEAD_IN_SAND_MAP) || defined(HEAD_IN_SAND_LINKS)
+  map_update(cptr);
+#endif
+
   if (feature_bool(FEAT_RELIABLE_CLOCK) &&
       abs(cli_serv(cptr)->timestamp - recv_time) > 30) {
     sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
@@ -675,10 +680,8 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   struct Client*   acptr;
   struct Client*   bcptr;
   struct Client*   LHcptr = 0;
-  struct ConfItem* aconf = 0;
   struct ConfItem* lhconf = 0;
   int              hop;
-  int              ret;
   int              active_lh_line = 0;
   unsigned short   prot;
   time_t           start_timestamp;
@@ -701,8 +704,6 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (strlen(parv[5]) != 3 || (parv[5][0] != 'P' && parv[5][0] != 'J'))
     return exit_client_msg(cptr, sptr, &me, "Bogus protocol (%s)", parv[5]);
 
-  *parv[5] = 'J';
-
   if (*parv[7] == '+') {
     for (ch = parv[7] + 1; *ch; ch++)
       switch (*ch) {
@@ -1076,6 +1077,9 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   Count_newremoteserver(UserStats);
   add_client_to_list(acptr);
   hAddClient(acptr);
+#if defined(HEAD_IN_SAND_MAP) || defined(HEAD_IN_SAND_LINKS)
+  map_update(acptr);
+#endif
 
   if (*parv[5] == 'J')
   {