2 * IRC - Internet Relay Chat, ircd/m_server.c
3 * Copyright (C) 1990 Jarkko Oikarinen and
4 * University of Oulu, Computing Center
6 * See file AUTHORS in IRC package for additional names of
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 1, or (at your option)
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * @brief Handlers for the SERVER command.
34 #include "ircd_features.h"
35 #include "ircd_reply.h"
36 #include "ircd_string.h"
43 #include "querycmds.h"
52 /* #include <assert.h> -- Now using assert in ircd_log.h */
56 /** Clean up a server name.
57 * @param[in] host Input server name.
58 * @return NULL if the name is invalid, else pointer to cleaned-up name.
61 clean_servername(char *host)
65 * Check for "FRENCH " infection ;-) (actually this should
66 * be replaced with routine to check the hostname syntax in
67 * general). [ This check is still needed, even after the parse
68 * is fixed, because someone can send "SERVER :foo bar " ].
69 * Also, changed to check other "difficult" characters, now
70 * that parse lets all through... --msa
72 if (strlen(host) > HOSTLEN)
75 for (ch = host; *ch; ch++)
76 if (*ch <= ' ' || *ch > '~')
78 if (*ch || !strchr(host, '.') || strlen(host) > HOSTLEN)
83 /** Parse protocol version from a string.
84 * @param[in] proto String version of protocol number.
85 * @return Zero if \a proto is unrecognized, else protocol version.
88 parse_protocol(const char *proto)
91 if (strlen(proto) != 3 || (proto[0] != 'P' && proto[0] != 'J'))
94 if (prot > atoi(MAJOR_PROTOCOL))
95 prot = atoi(MAJOR_PROTOCOL);
99 /** Reason not to accept a server's new announcement. */
101 ALLOWED, /**< The new server link is accepted. */
102 MAX_HOPS_EXCEEDED, /**< The path to the server is too long. */
103 NOT_ALLOWED_TO_HUB, /**< My peer is not allowed to hub for the server. */
104 I_AM_NOT_HUB /**< I have another active server link but not FEAT_HUB. */
107 /** Check whether the introduction of a new server would cause a loop
108 * or be disallowed by leaf and hub configuration directives.
109 * @param[in] cptr Neighbor who sent the message.
110 * @param[in] sptr Client that originated the message.
111 * @param[out] ghost If non-NULL, receives ghost timestamp for new server.
112 * @param[in] host Name of new server.
113 * @param[in] numnick Numnick mask of new server.
114 * @param[in] timestamp Claimed link timestamp of new server.
115 * @param[in] hop Number of hops to the new server.
116 * @param[in] junction Non-zero if the new server is still bursting.
117 * @return CPTR_KILLED if \a cptr was SQUIT. 0 if some other server
118 * was SQUIT. 1 if the new server is allowed.
121 check_loop_and_lh(struct Client* cptr, struct Client *sptr, time_t *ghost, const char *host, const char *numnick, time_t timestamp, int hop, int junction)
123 struct Client* acptr;
124 struct Client* LHcptr = NULL;
125 struct ConfItem* lhconf;
126 enum lh_type active_lh_line = ALLOWED;
133 * Calculate type of connect limit and applicable config item.
135 lhconf = find_conf_byname(cli_confs(cptr), cli_name(cptr), CONF_SERVER);
136 assert(lhconf != NULL);
139 if (!feature_bool(FEAT_HUB))
140 for (ii = 0; ii <= HighestFd; ii++)
141 if (LocalClientArray[ii] && IsServer(LocalClientArray[ii])) {
142 active_lh_line = I_AM_NOT_HUB;
146 else if (hop > lhconf->maximum)
148 /* Because "maximum" should be 0 for non-hub links, check whether
149 * there is a hub mask -- if not, complain that the server isn't
152 active_lh_line = lhconf->hub_limit ? MAX_HOPS_EXCEEDED : NOT_ALLOWED_TO_HUB;
154 else if (lhconf->hub_limit && match(lhconf->hub_limit, host))
156 struct Client *ac3ptr;
157 active_lh_line = NOT_ALLOWED_TO_HUB;
159 for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
160 if (IsJunction(ac3ptr)) {
167 * We want to find IsConnecting() and IsHandshake() too,
169 * The second finds collisions with numeric representation of existing
170 * servers - these shouldn't happen anymore when all upgraded to 2.10.
173 while ((acptr = FindClient(host))
174 || (numnick && (acptr = FindNServer(numnick))))
177 * This link is trying feed me a server that I already have
178 * access through another path
180 * Do not allow Uworld to do this.
181 * Do not allow servers that are juped.
182 * Do not allow servers that have older link timestamps
184 * Do not allow servers that use the same numeric as an existing
185 * server, but have a different name.
187 * If my ircd.conf sucks, I can try to connect to myself:
190 return exit_client_msg(cptr, cptr, &me, "nick collision with me (%s), check server number in M:?", host);
192 * Detect wrong numeric.
194 if (0 != ircd_strcmp(cli_name(acptr), host))
196 sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
197 ":SERVER Numeric Collision: %s != %s",
198 cli_name(acptr), host);
199 return exit_client_msg(cptr, cptr, &me,
200 "NUMERIC collision between %s and %s."
201 " Is your server numeric correct ?", host, cli_name(acptr));
204 * Kill our try, if we had one.
206 if (IsConnecting(acptr))
208 if (active_lh_line == ALLOWED && exit_client(cptr, acptr, &me,
209 "Just connected via another link") == CPTR_KILLED)
212 * We can have only ONE 'IsConnecting', 'IsHandshake' or
213 * 'IsServer', because new 'IsConnecting's are refused to
214 * the same server if we already had it.
219 * Avoid other nick collisions...
220 * This is a doubtful test though, what else would it be
221 * when it has a server.name ?
223 else if (!IsServer(acptr) && !IsHandshake(acptr))
224 return exit_client_msg(cptr, cptr, &me,
225 "Nickname %s already exists!", host);
227 * Our new server might be a juped server,
228 * or someone trying abuse a second Uworld:
230 else if (IsServer(acptr) && (0 == ircd_strncmp(cli_info(acptr), "JUPE", 4) ||
231 find_conf_byhost(cli_confs(cptr), cli_name(acptr), CONF_UWORLD)))
234 return exit_client(cptr, sptr, &me, cli_info(acptr));
235 sendcmdto_serv_butone(&me, CMD_WALLOPS, cptr,
236 ":Received :%s SERVER %s from %s !?!",
237 NumServ(cptr), host, cli_name(cptr));
238 return exit_new_server(cptr, sptr, host, timestamp, "%s", cli_info(acptr));
241 * Of course we find the handshake this link was before :)
243 else if (IsHandshake(acptr) && acptr == cptr)
246 * Here we have a server nick collision...
247 * We don't want to kill the link that was last /connected,
248 * but we neither want to kill a good (old) link.
249 * Therefor we kill the second youngest link.
253 struct Client* c2ptr = 0;
254 struct Client* c3ptr = acptr;
255 struct Client* ac2ptr;
256 struct Client* ac3ptr;
258 /* Search youngest link: */
259 for (ac3ptr = acptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
260 if (cli_serv(ac3ptr)->timestamp > cli_serv(c3ptr)->timestamp)
264 for (ac3ptr = sptr; ac3ptr != &me; ac3ptr = cli_serv(ac3ptr)->up)
265 if (cli_serv(ac3ptr)->timestamp > cli_serv(c3ptr)->timestamp)
268 if (timestamp > cli_serv(c3ptr)->timestamp)
271 c2ptr = acptr; /* Make sure they differ */
273 /* Search second youngest link: */
274 for (ac2ptr = acptr; ac2ptr != &me; ac2ptr = cli_serv(ac2ptr)->up)
275 if (ac2ptr != c3ptr &&
276 cli_serv(ac2ptr)->timestamp >
277 (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
281 for (ac2ptr = sptr; ac2ptr != &me; ac2ptr = cli_serv(ac2ptr)->up)
282 if (ac2ptr != c3ptr &&
283 cli_serv(ac2ptr)->timestamp >
284 (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
287 if (c3ptr && timestamp > (c2ptr ? cli_serv(c2ptr)->timestamp : timestamp))
289 /* If timestamps are equal, decide which link to break
292 if ((c2ptr ? cli_serv(c2ptr)->timestamp : timestamp) ==
293 (c3ptr ? cli_serv(c3ptr)->timestamp : timestamp))
295 const char *n2, *n2up, *n3, *n3up;
298 n2 = cli_name(c2ptr);
299 n2up = MyConnect(c2ptr) ? cli_name(&me) : cli_name(cli_serv(c2ptr)->up);
304 n2up = IsServer(sptr) ? cli_name(sptr) : cli_name(&me);
308 n3 = cli_name(c3ptr);
309 n3up = MyConnect(c3ptr) ? cli_name(&me) : cli_name(cli_serv(c3ptr)->up);
314 n3up = IsServer(sptr) ? cli_name(sptr) : cli_name(&me);
316 if (strcmp(n2, n2up) > 0)
318 if (strcmp(n3, n3up) > 0)
320 if (strcmp(n3, n2) > 0)
327 /* Now squit the second youngest link: */
329 return exit_new_server(cptr, sptr, host, timestamp,
330 "server %s already exists and is %ld seconds younger.",
331 host, (long)cli_serv(acptr)->timestamp - (long)timestamp);
332 else if (cli_from(c2ptr) == cptr || IsServer(sptr))
334 struct Client *killedptrfrom = cli_from(c2ptr);
335 if (active_lh_line != ALLOWED)
338 * If the L: or H: line also gets rid of this link,
339 * we sent just one squit.
341 if (LHcptr && a_kills_b_too(LHcptr, c2ptr))
344 * If breaking the loop here solves the L: or H:
345 * line problem, we don't squit that.
347 if (cli_from(c2ptr) == cptr || (LHcptr && a_kills_b_too(c2ptr, LHcptr)))
348 active_lh_line = ALLOWED;
352 * If we still have a L: or H: line problem,
353 * we prefer to squit the new server, solving
354 * loop and L:/H: line problem with only one squit.
361 * If the new server was introduced by a server that caused a
362 * Ghost less then 20 seconds ago, this is probably also
363 * a Ghost... (20 seconds is more then enough because all
364 * SERVER messages are at the beginning of a net.burst). --Run
366 if (CurrentTime - cli_serv(cptr)->ghost < 20)
368 killedptrfrom = cli_from(acptr);
369 if (exit_client(cptr, acptr, &me, "Ghost loop") == CPTR_KILLED)
372 else if (exit_client_msg(cptr, c2ptr, &me,
373 "Loop <-- %s (new link is %ld seconds younger)", host,
374 (c3ptr ? (long)cli_serv(c3ptr)->timestamp : timestamp) -
375 (long)cli_serv(c2ptr)->timestamp) == CPTR_KILLED)
378 * Did we kill the incoming server off already ?
380 if (killedptrfrom == cptr)
385 if (active_lh_line != ALLOWED)
387 if (LHcptr && a_kills_b_too(LHcptr, acptr))
389 if (cli_from(acptr) == cptr || (LHcptr && a_kills_b_too(acptr, LHcptr)))
390 active_lh_line = ALLOWED;
398 * We can't believe it is a lagged server message
399 * when it directly connects to us...
400 * kill the older link at the ghost, rather then
401 * at the second youngest link, assuming it isn't
405 *ghost = CurrentTime; /* Mark that it caused a ghost */
406 if (exit_client(cptr, acptr, &me, "Ghost") == CPTR_KILLED)
413 if (active_lh_line != ALLOWED)
417 if (active_lh_line == MAX_HOPS_EXCEEDED)
419 return exit_client_msg(cptr, LHcptr, &me,
420 "Maximum hops exceeded for %s at %s",
421 cli_name(cptr), host);
423 else if (active_lh_line == NOT_ALLOWED_TO_HUB)
425 return exit_client_msg(cptr, LHcptr, &me,
426 "%s is not allowed to hub for %s",
427 cli_name(cptr), host);
429 else /* I_AM_NOT_HUB */
431 ServerStats->is_ref++;
432 return exit_client(cptr, LHcptr, &me, "I'm a leaf, define HUB");
439 /** Update server start timestamps and TS offsets.
440 * @param[in] cptr Server that just connected.
441 * @param[in] timestamp Current time according to \a cptr.
442 * @param[in] start_timestamp Time that \a cptr started.
443 * @param[in] recv_time Current time as we know it.
446 check_start_timestamp(struct Client *cptr, time_t timestamp, time_t start_timestamp, time_t recv_time)
448 Debug((DEBUG_DEBUG, "My start time: %Tu; other's start time: %Tu",
449 cli_serv(&me)->timestamp, start_timestamp));
450 Debug((DEBUG_DEBUG, "Receive time: %Tu; received timestamp: %Tu; "
451 "difference %ld", recv_time, timestamp, timestamp - recv_time));
452 if (feature_bool(FEAT_RELIABLE_CLOCK)) {
453 if (start_timestamp < cli_serv(&me)->timestamp)
454 cli_serv(&me)->timestamp = start_timestamp;
456 cli_serv(cptr)->timestamp = TStime();
457 } else if (start_timestamp < cli_serv(&me)->timestamp) {
458 sendto_opmask_butone(0, SNO_OLDSNO, "got earlier start time: "
459 "%Tu < %Tu", start_timestamp,
460 cli_serv(&me)->timestamp);
461 cli_serv(&me)->timestamp = start_timestamp;
462 TSoffset += timestamp - recv_time;
463 sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
464 (int)(timestamp - recv_time));
465 } else if ((start_timestamp > cli_serv(&me)->timestamp) &&
467 cli_serv(cptr)->timestamp = TStime();
468 } else if (timestamp != recv_time) {
470 * Equal start times, we have a collision. Let the connected-to
471 * server decide. This assumes leafs issue more than half of the
472 * connection attempts.
475 cli_serv(cptr)->timestamp = TStime();
476 else if (IsHandshake(cptr)) {
477 sendto_opmask_butone(0, SNO_OLDSNO, "clock adjusted by adding %d",
478 (int)(timestamp - recv_time));
479 TSoffset += timestamp - recv_time;
484 /** Interpret a server's flags.
486 * @param[in] cptr New server structure.
487 * @param[in] flags String listing server's P10 flags.
489 void set_server_flags(struct Client *cptr, const char *flags)
491 while (*flags) switch (*flags++) {
492 case 'h': SetHub(cptr); break;
493 case 's': SetService(cptr); break;
494 case '6': SetIPv6(cptr); break;
498 /** Handle a SERVER message from an unregistered connection.
500 * \a parv has the following elements:
501 * \li \a parv[1] is the server name
502 * \li \a parv[2] is the hop count to the server
503 * \li \a parv[3] is the start timestamp for the server
504 * \li \a parv[4] is the link timestamp
505 * \li \a parv[5] is the protocol version (P10 or J10)
506 * \li \a parv[6] is the numnick mask for the server
507 * \li \a parv[7] is a string of flags like +hs to mark hubs and services
508 * \li \a parv[\a parc - 1] is the server description
510 * See @ref m_functions for discussion of the arguments.
511 * @param[in] cptr Client that sent us the message.
512 * @param[in] sptr Original source of message.
513 * @param[in] parc Number of arguments.
514 * @param[in] parv Argument vector.
516 int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
519 struct ConfItem* aconf;
524 time_t start_timestamp;
529 if (IsUserPort(cptr))
530 return exit_client_msg(cptr, cptr, &me,
531 "Cannot connect a server to a user port");
535 need_more_params(sptr, "SERVER");
536 return exit_client(cptr, cptr, &me, "Need more parameters");
538 host = clean_servername(parv[1]);
541 sendto_opmask_butone(0, SNO_OLDSNO, "Bogus server name (%s) from %s",
542 host, cli_name(cptr));
543 return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
546 if ((ajupe = jupe_find(host)) && JupeIsActive(ajupe))
547 return exit_client_msg(cptr, sptr, &me, "Juped: %s", JupeReason(ajupe));
549 /* check connection rules */
550 if (0 != conf_eval_crule(host, CRULE_ALL)) {
551 ServerStats->is_ref++;
552 sendto_opmask_butone(0, SNO_OLDSNO, "Refused connection from %s.", cli_name(cptr));
553 return exit_client(cptr, cptr, &me, "Disallowed by connection rule");
556 log_write(LS_NETWORK, L_NOTICE, LOG_NOSNOTICE, "SERVER: %s %s[%s]", host,
557 cli_sockhost(cptr), cli_sock_ip(cptr));
563 start_timestamp = atoi(parv[3]);
564 timestamp = atoi(parv[4]);
565 prot = parse_protocol(parv[5]);
567 return exit_client_msg(cptr, sptr, &me, "Bogus protocol (%s)", parv[5]);
568 else if (prot < atoi(MINOR_PROTOCOL))
569 return exit_new_server(cptr, sptr, host, timestamp,
570 "Incompatible protocol: %s", parv[5]);
572 Debug((DEBUG_INFO, "Got SERVER %s with timestamp [%s] age %Tu (%Tu)",
573 host, parv[4], start_timestamp, cli_serv(&me)->timestamp));
575 if (timestamp < OLDEST_TS || start_timestamp < OLDEST_TS)
576 return exit_client_msg(cptr, sptr, &me,
577 "Bogus timestamps (%s %s)", parv[3], parv[4]);
579 /* If the server had a different name before, change it. */
580 if (!EmptyString(cli_name(cptr)) &&
581 (IsUnknown(cptr) || IsHandshake(cptr)) &&
582 0 != ircd_strcmp(cli_name(cptr), host))
583 hChangeClient(cptr, host);
584 ircd_strncpy(cli_name(cptr), host, HOSTLEN);
585 ircd_strncpy(cli_info(cptr), parv[parc-1][0] ? parv[parc-1] : cli_name(&me), REALLEN);
586 cli_hopcount(cptr) = hop;
588 if (conf_check_server(cptr)) {
589 ++ServerStats->is_ref;
590 sendto_opmask_butone(0, SNO_OLDSNO, "Received unauthorized connection "
591 "from %s.", cli_name(cptr));
592 log_write(LS_NETWORK, L_NOTICE, LOG_NOSNOTICE, "Received unauthorized "
593 "connection from %C [%s]", cptr,
594 ircd_ntoa(&cli_ip(cptr)));
595 return exit_client(cptr, cptr, &me, "No Connect block");
598 host = cli_name(cptr);
602 if (!(aconf = find_conf_byname(cli_confs(cptr), host, CONF_SERVER))) {
603 ++ServerStats->is_ref;
604 sendto_opmask_butone(0, SNO_OLDSNO, "Access denied. No conf line for "
605 "server %s", cli_name(cptr));
606 return exit_client_msg(cptr, cptr, &me,
607 "Access denied. No conf line for server %s", cli_name(cptr));
610 if (*aconf->passwd && !!strcmp(aconf->passwd, cli_passwd(cptr))) {
611 ++ServerStats->is_ref;
612 sendto_opmask_butone(0, SNO_OLDSNO, "Access denied (passwd mismatch) %s",
614 return exit_client_msg(cptr, cptr, &me,
615 "No Access (passwd mismatch) %s", cli_name(cptr));
618 memset(cli_passwd(cptr), 0, sizeof(cli_passwd(cptr)));
620 ret = check_loop_and_lh(cptr, sptr, &ghost, host, (parc > 7 ? parv[6] : NULL), timestamp, hop, 1);
625 cli_serv(cptr)->timestamp = timestamp;
626 cli_serv(cptr)->prot = prot;
627 cli_serv(cptr)->ghost = ghost;
628 memset(cli_privs(cptr), 255, sizeof(struct Privs));
629 ClrPriv(cptr, PRIV_SET);
630 SetServerYXX(cptr, cptr, parv[6]);
632 /* Attach any necessary UWorld config items. */
633 attach_confs_byhost(cptr, host, CONF_UWORLD);
636 set_server_flags(cptr, parv[7] + 1);
638 recv_time = TStime();
639 check_start_timestamp(cptr, timestamp, start_timestamp, recv_time);
640 ret = server_estab(cptr, aconf);
642 if (feature_bool(FEAT_RELIABLE_CLOCK) &&
643 abs(cli_serv(cptr)->timestamp - recv_time) > 30) {
644 sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
645 "timestamp-clock difference of %Td seconds! "
646 "Used SETTIME to correct this.",
647 timestamp - recv_time);
648 sendcmdto_prio_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(),
655 /** Handle a SERVER message from another server.
657 * \a parv has the following elements:
658 * \li \a parv[1] is the server name
659 * \li \a parv[2] is the hop count to the server
660 * \li \a parv[3] is the start timestamp for the server
661 * \li \a parv[4] is the link timestamp
662 * \li \a parv[5] is the protocol version (P10 or J10)
663 * \li \a parv[6] is the numnick mask for the server
664 * \li \a parv[7] is a string of flags like +hs to mark hubs and services
665 * \li \a parv[\a parc - 1] is the server description
667 * See @ref m_functions for discussion of the arguments.
668 * @param[in] cptr Client that sent us the message.
669 * @param[in] sptr Original source of message.
670 * @param[in] parc Number of arguments.
671 * @param[in] parv Argument vector.
673 int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
677 struct Client* acptr;
678 struct Client* bcptr;
682 time_t start_timestamp;
687 return need_more_params(sptr, "SERVER");
688 return exit_client(cptr, cptr, &me, "Need more parameters");
690 host = clean_servername(parv[1]);
693 sendto_opmask_butone(0, SNO_OLDSNO, "Bogus server name (%s) from %s",
694 host, cli_name(cptr));
695 return exit_client_msg(cptr, cptr, &me, "Bogus server name (%s)", host);
702 start_timestamp = atoi(parv[3]);
703 timestamp = atoi(parv[4]);
704 prot = parse_protocol(parv[5]);
706 return exit_client_msg(cptr, sptr, &me, "Bogus protocol (%s)", parv[5]);
707 else if (prot < atoi(MINOR_PROTOCOL))
708 return exit_new_server(cptr, sptr, host, timestamp,
709 "Incompatible protocol: %s", parv[5]);
711 Debug((DEBUG_INFO, "Got SERVER %s with timestamp [%s] age %Tu (%Tu)",
712 host, parv[4], start_timestamp, cli_serv(&me)->timestamp));
714 if (timestamp < OLDEST_TS)
715 return exit_client_msg(cptr, sptr, &me,
716 "Bogus timestamps (%s %s)", parv[3], parv[4]);
718 if (parv[parc - 1][0] == '\0')
719 return exit_client_msg(cptr, cptr, &me,
720 "No server info specified for %s", host);
722 ret = check_loop_and_lh(cptr, sptr, NULL, host, (parc > 7 ? parv[6] : NULL), timestamp, hop, parv[5][0] == 'J');
727 * Server is informing about a new server behind
728 * this link. Create REMOTE server structure,
729 * add it to list and propagate word to my other
733 acptr = make_client(cptr, STAT_SERVER);
735 cli_serv(acptr)->prot = prot;
736 cli_serv(acptr)->timestamp = timestamp;
737 cli_hopcount(acptr) = hop;
738 ircd_strncpy(cli_name(acptr), host, HOSTLEN);
739 ircd_strncpy(cli_info(acptr), parv[parc-1], REALLEN);
740 cli_serv(acptr)->up = sptr;
741 cli_serv(acptr)->updown = add_dlink(&(cli_serv(sptr))->down, acptr);
742 /* Use cptr, because we do protocol 9 -> 10 translation
743 for numeric nicks ! */
744 SetServerYXX(cptr, acptr, parv[6]);
746 /* Attach any necessary UWorld config items. */
747 attach_confs_byhost(cptr, host, CONF_UWORLD);
750 set_server_flags(acptr, parv[7] + 1);
752 Count_newremoteserver(UserStats);
753 if (Protocol(acptr) < 10)
754 SetFlag(acptr, FLAG_TS8);
755 add_client_to_list(acptr);
761 for (bcptr = cli_serv(acptr)->up; !IsMe(bcptr); bcptr = cli_serv(bcptr)->up)
762 if (IsBurstOrBurstAck(bcptr))
765 sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
766 cli_name(sptr), cli_name(acptr));
769 * Old sendto_serv_but_one() call removed because we now need to send
770 * different names to different servers (domain name matching).
772 for (i = 0; i <= HighestFd; i++)
774 if (!(bcptr = LocalClientArray[i]) || !IsServer(bcptr) ||
775 bcptr == cptr || IsMe(bcptr))
777 if (0 == match(cli_name(&me), cli_name(acptr)))
779 sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s +%s%s%s :%s",
780 cli_name(acptr), hop + 1, parv[4], parv[5],
781 NumServCap(acptr), IsHub(acptr) ? "h" : "",
782 IsService(acptr) ? "s" : "", IsIPv6(acptr) ? "6" : "",