37 |
|
#include "fdlist.h" |
38 |
|
#include "hash.h" |
39 |
|
#include "irc_string.h" |
40 |
– |
#include "inet_misc.h" |
40 |
|
#include "sprintf_irc.h" |
41 |
|
#include "ircd.h" |
42 |
|
#include "ircd_defs.h" |
43 |
|
#include "s_bsd.h" |
45 |
– |
#include "irc_getnameinfo.h" |
44 |
|
#include "numeric.h" |
45 |
|
#include "packet.h" |
46 |
|
#include "irc_res.h" |
670 |
|
ClearCap(client_p, CAP_TBURST); |
671 |
|
} |
672 |
|
|
675 |
– |
/* Don't unset CAP_HUB here even if the server isn't a hub, |
676 |
– |
* it only indicates if the server thinks it's lazylinks are |
677 |
– |
* leafs or not.. if you unset it, bad things will happen |
678 |
– |
*/ |
673 |
|
if (aconf != NULL) |
674 |
|
{ |
675 |
|
struct sockaddr_in *v4; |
955 |
|
char *host; |
956 |
|
const char *inpath; |
957 |
|
static char inpath_ip[HOSTLEN * 2 + USERLEN + 6]; |
964 |
– |
dlink_node *m; |
958 |
|
dlink_node *ptr; |
959 |
|
|
960 |
|
assert(client_p != NULL); |
1007 |
|
|
1008 |
|
/* Pass my info to the new server |
1009 |
|
* |
1017 |
– |
* If this is a HUB, pass on CAP_HUB |
1010 |
|
* Pass on ZIP if supported |
1011 |
|
* Pass on TB if supported. |
1012 |
|
* - Dianora |
1013 |
|
*/ |
1014 |
|
|
1015 |
< |
send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0) |
1016 |
< |
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1015 |
> |
send_capabilities(client_p, aconf, |
1016 |
> |
(IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1017 |
|
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0); |
1018 |
|
|
1019 |
|
/* SERVER is the last command sent before switching to ziplinks. |
1085 |
|
/* Some day, all these lists will be consolidated *sigh* */ |
1086 |
|
dlinkAdd(client_p, &client_p->lnode, &me.serv->server_list); |
1087 |
|
|
1088 |
< |
m = dlinkFind(&unknown_list, client_p); |
1097 |
< |
assert(NULL != m); |
1088 |
> |
assert(dlinkFind(&unknown_list, client_p)); |
1089 |
|
|
1090 |
< |
dlinkDelete(m, &unknown_list); |
1091 |
< |
dlinkAdd(client_p, m, &serv_list); |
1090 |
> |
dlink_move_node(&client_p->localClient->lclient_node, |
1091 |
> |
&unknown_list, &serv_list); |
1092 |
|
|
1093 |
|
Count.myserver++; |
1094 |
|
|
1101 |
|
/* fixing eob timings.. -gnp */ |
1102 |
|
client_p->firsttime = CurrentTime; |
1103 |
|
|
1104 |
+ |
|
1105 |
+ |
if (find_matching_name_conf(SERVICE_TYPE, client_p->name, NULL, NULL, 0)) |
1106 |
+ |
SetService(client_p); |
1107 |
+ |
|
1108 |
|
/* Show the real host/IP to admins */ |
1109 |
|
sendto_realops_flags(UMODE_ALL, L_ADMIN, |
1110 |
|
"Link with %s established: (%s) link", |
1568 |
|
conf = unmap_conf_item(aconf); |
1569 |
|
|
1570 |
|
/* log */ |
1571 |
< |
irc_getnameinfo((struct sockaddr*)&aconf->ipnum, aconf->ipnum.ss_len, |
1572 |
< |
buf, HOSTIPLEN, NULL, 0, NI_NUMERICHOST); |
1571 |
> |
getnameinfo((struct sockaddr *)&aconf->ipnum, aconf->ipnum.ss_len, |
1572 |
> |
buf, sizeof(buf), NULL, 0, NI_NUMERICHOST); |
1573 |
|
ilog(L_NOTICE, "Connect to %s[%s] @%s", aconf->user, aconf->host, |
1574 |
|
buf); |
1575 |
|
|
1833 |
|
|
1834 |
|
/* Pass my info to the new server |
1835 |
|
* |
1841 |
– |
* If this is a HUB, pass on CAP_HUB |
1836 |
|
* Pass on ZIP if supported |
1837 |
|
* Pass on TB if supported. |
1838 |
|
* - Dianora |
1839 |
|
*/ |
1840 |
< |
send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0) |
1841 |
< |
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1840 |
> |
send_capabilities(client_p, aconf, |
1841 |
> |
(IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1842 |
|
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), 0); |
1843 |
|
|
1844 |
|
sendto_one(client_p, "SERVER %s 1 :%s%s", |
1946 |
|
return; |
1947 |
|
} |
1948 |
|
|
1949 |
< |
send_capabilities(client_p, aconf, (ServerInfo.hub ? CAP_HUB : 0) |
1950 |
< |
| (IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1949 |
> |
send_capabilities(client_p, aconf, |
1950 |
> |
(IsConfCompressed(aconf) ? CAP_ZIP : 0) |
1951 |
|
| (IsConfTopicBurst(aconf) ? CAP_TBURST|CAP_TB : 0), CAP_ENC_MASK); |
1952 |
|
|
1953 |
|
sendto_one(client_p, "PASS . TS %d %s", TS_CURRENT, me.id); |