Network input problem

Cyril Deguet cyril at sphinx.via.ecp.fr
Wed Nov 21 17:01:57 CET 2001


Ok I think I have found the problem, and in my case it has nothing to do   
with linux, nor glibc (nor vlc ;-) !

When vlc calls "network_BuildLocalAddr", it tries to get local
hostname when a broadcast address isn't specified, with a
        gethostname(psz_hostname, sizeof(psz_hostname).
Then the name is converted to an IP address with
        p_socket->sin_addr.s_addr = inet_addr( psz_hostname )
I had a look in my /etc/hosts, and the first line was
"127.0.0.1 localhost sphinx", so inet_addr returns 127.0.0.1, and
the "connect" fails, because linux kernel forbids connecting a socket
on 127.0.0.1 when server host isn't 127.0.0.1 too.
When I remove "sphinx" from /etc/hosts, everything works fine.

-- 
Cyril




More information about the vlc-devel mailing list