- summary: IIP ues wrong source address with outgoing connections --> IIP uses wrong source address with outgoing connections
Hi.
I have set up IIP as public relay on a server with several IP
addresses bound to the outgoing interface. I managed to restrict IIP
to only one IP address (he does not listen to 0.0.0.0 anymore), but
to A.B.C.D. This is done manually in listen.ref.
But when IIP opens outbound connections, always the primary IP
address is used, not the one set up for listening socket. The cause
is that in net/sock.c, near line 424, when he binds to socket, 0.0.0.0
is set in sh->LocalSockAddress.sin_addr, not the real IP address.
As I am not a real C programmer, I have not tracked that down, but
just solved this by hardcoding the IP address in sockSetNodeRef
near line 312:
sh->LocalSockAddress.sin_addr.s_addr = inet_addr("A.B.C.D");
where A.B.C.D is my outgoing IP address for IIP.