log(DEBUG,"(%d) Comparing against name='%s', ipaddr='%s', port='%s', recvpass='%s'",i,Link_ServerName,Link_IPAddr,Link_Port,Link_Pass);
LinkPort = atoi(Link_Port);
- if (!strcasecmp(Link_ServerName,servername)) {
- if (!strcasecmp(Link_IPAddr,udp_host)) {
- if (LinkPort == udp_port) {
- // matching link at this end too, we're all done!
- // at this point we must begin key exchange and insert this
- // server into our 'active' table.
- for (int j = 0; j < 255; j++) {
- if (servers[j] != NULL) {
- if (!strcasecmp(servers[j]->internal_addr,udp_host)) {
- strcpy(servers[j]->description,serverdesc);
- WriteOpers("Server %s authenticated, exchanging server keys...",servername);
- snprintf(response,10240,"O %d",MyKey);
- serv->SendPacket(response,udp_host,udp_port,0);
- return;
- }
- }
+ if (!strcasecmp(Link_ServerName,servername))
+ {
+ // matching link at this end too, we're all done!
+ // at this point we must begin key exchange and insert this
+ // server into our 'active' table.
+ for (int j = 0; j < 255; j++)
+ {
+ if (servers[j] != NULL)
+ {
+ if (!strcasecmp(servers[j]->name,udp_host))
+ {
+ strcpy(servers[j]->description,serverdesc);
+ DoSync(serv,udp_host);
+ char buffer[MAXBUF];
+ sprintf(buffer,"X 0");
+ serv->SendPacket(buffer,udp_host);
+ return;
}
- WriteOpers("\2WARNING!\2 %s sent us an authentication packet but we are not authenticating with this server right noe! Possible intrusion attempt!",udp_host);
- return;
-
}
- else {
- log(DEBUG,"Port numbers '%d' and '%d' don't match",LinkPort,udp_port);
- }
- }
- else {
- log(DEBUG,"IP Addresses '%s' and '%s' don't match",Link_IPAddr,udp_host);
+ WriteOpers("\2WARNING!\2 %s sent us an authentication packet but we are not authenticating with this server right noe! Possible intrusion attempt!",udp_host);
+ return;
}
}
else {
log(DEBUG,"Server names '%s' and '%s' don't match",Link_ServerName,servername);
}
}
- serv->SendPacket("E :Access is denied (no matching link block)",udp_host,udp_port,0);
+ char buffer[MAXBUF];
+ sprintf(buffer,"E :Access is denied (no matching link block)");
+ serv->SendPacket(buffer,udp_host);
WriteOpers("CONNECT from %s denied, no matching link block",servername);