Fixing a small detection error

This commit is contained in:
Michiel Broek 2006-01-29 10:35:48 +00:00
parent e8f8f096a2
commit 3ff96b3cb2

View File

@ -1781,21 +1781,26 @@ void receiver(struct servent *se)
memcpy(&in, tp->h_addr, tp->h_length); memcpy(&in, tp->h_addr, tp->h_length);
if (strcmp(inet_ntoa(in), ipaddress) == 0) { if (strcmp(inet_ntoa(in), ipaddress) == 0) {
/* /*
* Store the back resolved IP fqdn for reference and change the * Test if the backresolved dynamic DNS name is changed, but exclude the
* FQDN to the one from the setup, so we continue to use the * initial value which is the same as the real server name.
* dynamic FQDN.
*/ */
if (strcmp(tnsl->resolved, hostname)) { if (strcmp(tnsl->resolved, hostname) && strcmp(tnsl->resolved, tnsl->server)) {
Syslog('r', "IBC: old resolved %s new resolved %s state %s", Syslog('r', "IBC: GrepThiz old resolved %s new resolved %s state %s",
tnsl->resolved, hostname, ncsstate[tnsl->state]); tnsl->resolved, hostname, ncsstate[tnsl->state]);
/* /*
* This would be the moment to reset this neighbour * This would be the moment to reset this neighbour
* Double check state: waitpwd or call ? * Double check state: waitpwd or call ?
*/ */
} }
/*
* Store the back resolved IP fqdn for reference and change the
* FQDN to the one from the setup, so we continue to use the
* dynamic FQDN.
*/
if (strcmp(tnsl->resolved, hostname))
Syslog('r', "IBC: setting '%s' to dynamic dns '%s'", hostname, tnsl->server);
strncpy(tnsl->resolved, hostname, 63); strncpy(tnsl->resolved, hostname, 63);
inlist = TRUE; inlist = TRUE;
Syslog('r', "IBC: setting '%s' to dynamic dns '%s'", tnsl->resolved, tnsl->server);
hostname = tnsl->server; hostname = tnsl->server;
break; break;
} }