}
}
+/** Interpret a server's flags.
+ *
+ * @param[in] cptr New server structure.
+ * @param[in] flags String listing server's P10 flags.
+ */
+void set_server_flags(struct Client *cptr, const char *flags)
+{
+ while (*flags) switch (*flags++) {
+ case 'h': SetHub(cptr); break;
+ case 's': SetService(cptr); break;
+ case '6': SetIPv6(cptr); break;
+ }
+}
+
/** Handle a SERVER message from an unregistered connection.
*
* \a parv has the following elements:
*/
int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
- char* ch;
char* host;
struct ConfItem* aconf;
struct Jupe* ajupe;
log_write(LS_NETWORK, L_NOTICE, LOG_NOSNOTICE, "Received unauthorized "
"connection from %C [%s]", cptr,
ircd_ntoa(&cli_ip(cptr)));
- return exit_client(cptr, cptr, &me, "No C:line");
+ return exit_client(cptr, cptr, &me, "No Connect block");
}
host = cli_name(cptr);
/* Attach any necessary UWorld config items. */
attach_confs_byhost(cptr, host, CONF_UWORLD);
- if (*parv[7] == '+') {
- for (ch = parv[7] + 1; *ch; ch++)
- switch (*ch) {
- case 'h':
- SetHub(cptr);
- break;
- case 's':
- SetService(cptr);
- break;
- }
- }
+ if (*parv[7] == '+')
+ set_server_flags(cptr, parv[7] + 1);
recv_time = TStime();
check_start_timestamp(cptr, timestamp, start_timestamp, recv_time);
*/
int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
- char* ch;
int i;
char* host;
struct Client* acptr;
/* Attach any necessary UWorld config items. */
attach_confs_byhost(cptr, host, CONF_UWORLD);
- if (*parv[7] == '+') {
- for (ch = parv[7] + 1; *ch; ch++)
- switch (*ch) {
- case 'h':
- SetHub(acptr);
- break;
- case 's':
- SetService(acptr);
- break;
- }
- }
+ if (*parv[7] == '+')
+ set_server_flags(acptr, parv[7] + 1);
Count_newremoteserver(UserStats);
if (Protocol(acptr) < 10)
if (*parv[5] == 'J')
{
SetBurst(acptr);
- sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
- cli_name(sptr), cli_name(acptr));
SetJunction(acptr);
+ for (bcptr = cli_serv(acptr)->up; !IsMe(bcptr); bcptr = cli_serv(bcptr)->up)
+ if (IsBurstOrBurstAck(bcptr))
+ break;
+ if (IsMe(bcptr))
+ sendto_opmask_butone(0, SNO_NETWORK, "Net junction: %s %s",
+ cli_name(sptr), cli_name(acptr));
}
/*
* Old sendto_serv_but_one() call removed because we now need to send
continue;
if (0 == match(cli_name(&me), cli_name(acptr)))
continue;
- sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s +%s%s :%s",
+ sendcmdto_one(sptr, CMD_SERVER, bcptr, "%s %d 0 %s %s %s%s +%s%s%s :%s",
cli_name(acptr), hop + 1, parv[4], parv[5],
NumServCap(acptr), IsHub(acptr) ? "h" : "",
- IsService(acptr) ? "s" : "", cli_info(acptr));
+ IsService(acptr) ? "s" : "", IsIPv6(acptr) ? "6" : "",
+ cli_info(acptr));
}
return 0;
}