[JDEV] question on dialback.c
Frank Koenen
fkoenen at vonworld.com
Tue Mar 11 17:06:02 CST 2003
hello.
can anyone give me insight on the following lines of code in the function dialback_out_read() in dialback.c:
/* make sure we're not connecting to ourselves */
if( ghash_get( c->d->in_id, xmlnode_get_attrib( x , "id" ) ) != NULL)
{
log_alert(c->key->server,"hostname maps back to ourselves!");
mio_write(m, NULL, "<stream:error>Mirror Mirror on the wall</stream:error>", -1);
mio_close(m);
break;
}
i've run into a problem using multiple jabber servers on a single server, listening on virtual network interfaces.
when i try to add roster items of users from one server to the next, i get the "hostname maps back to ourselves!"
error. When I enable -D debug mode on the servers to snoop on them... the problem doesn't happen.
I have two servers, one running on 10.10.12.10 and one running on 10.10.12.11, using a test environment and a locally
configured DNS server to test. The hostnames and reverse lookups are correct.
When I comment out the lines of code above from the dialback.c, everything works okay.
Any reason why the 'ghash_get( c->d->in_id, xmlnode_get_attrib( x , "id" ) ) != NULL' statement causes a false truth?
Is it safe to comment this block of logic altogether?
Thanks.
--
Frank Koenen
Dir. of Technical Services
Monet Technologies Inc.
Email: fkoenen at vonworld.com
Details on the problem follow:
-----------------------------------------------------------------------------------
some output from an 'nslookup' on the local server:
> jabberdebug.koenen.com
Server: 192.10.100.97
Address: 192.10.100.97#53
Name: jabberdebug.koenen.com
Address: 10.10.12.11
> 10.10.12.11
Server: 192.10.100.97
Address: 192.10.100.97#53
11.12.10.10.in-addr.arpa name = jabberdebug.koenen.com.
> jabberdebug2.koenen.com
Server: 192.10.100.97
Address: 192.10.100.97#53
Name: jabberdebug2.koenen.com
Address: 10.10.12.10
> 10.10.12.10
Server: 192.10.100.97
Address: 192.10.100.97#53
10.12.10.10.in-addr.arpa name = jabberdebug2.koenen.com.
------------------------------------------------------------------------------------------
I send: <presence type='subscribe' to='fkoenen at jabberdebug.koenen.com'/> from my login on the server jabberdebug2.koenen.com(10.10.12.10)
when I get the error: 'hostname maps back to ourselves'.
------------------------------------------------------------------------------------------
here's a snippet from my jabber.xml file:
<service id="s2s">
<load>
<dialback>./dialback/dialback.so</dialback>
</load>
<dialback xmlns='jabber:config:dialback'>
<legacy/>
<!-- Use these to listen on particular addresses and/or ports.
<ip port="7000"/>
<ip port="5269">127.0.0.1</ip>
-->
<ip port="5269">10.10.12.10</ip>
<karma>
<init>50</init>
<max>50</max>
<inc>4</inc>
<dec>1</dec>
<penalty>-5</penalty>
<restore>50</restore>
</karma>
</dialback>
</service>
the same entry is in the other server jabber.xml file too, except the "10.10.12.10" is changed to "10.10.12.11"
More information about the JDev
mailing list