Archived

This forum has been archived. Please start a new discussion on GitHub.

Address family not supported by protocol

Hi,

We are using Ice v3.5.1.

We meet an Exception:
Network.cpp:181: Ice::SocketException:
socket exception: Address family not supported by protocol

So,

1 What is the reason that throws an exception?

2 How should we solve this problem?

:)
Thanks,
Gu.

Comments

  • We tried to set Ice.IPv6=0, but it has no effect.:(
  • benoit
    benoit Rennes, France
    Hi,

    It looks like you don't have an IPv6 stack installed on your machine. On which platform do you get this?

    Setting Ice.IPv6=0 should solve the problem, it's not clear why it doesn't work for you. Did you set it before the communicator is initialized?

    Did you try to reproduce the issue with one of the Ice demo and try to add Ice.IPv6=0 in the demo configuration file to see if it solved the problem (assuming you can reproduce with the demo)?

    Cheers,
    Benoit.
  • Thanks,
    Benoit

    It has some problem when our program initialized? We modified the code and wait more tests.

    :)
    Gu.
  • benoit
    benoit Rennes, France
    Hi,

    Most configuration properties are read only once on the Ice communicator initialization. If they are changed or set after the communicator is initialized, the property won't be taken into account.

    Cheers,
    Benoit.
  • When IPv6 is not available, Ice should not throw an exception but simply not bind to IPv6 addresses and continue.

    It shouldn't be necessary to change the configuration of Ice applications depending on the environment they run in.

    This is a major problem for us where we deploy applications on Linux systems which have IPv6 disabled by default (because it isn't needed), but hardcoding Ice.IPv6=0 in the applications to prevent them from crashing on startup would permanently disable IPv6 support even if desired by the customer (and no, our users are not supposed to have to tinker with Ice configuration files).
  • benoit
    benoit Rennes, France
    Hi Christian,

    I agree, we'll look into fixing this for the next release. I believe this is only a Windows platform issue however. Could you detail on which Linux platform you got this? On Linux, a server shouldn't fail creating an object adapter if IPv6 is disabled on the OS but not disabled with Ice.IPv6=0.

    Cheers,
    Benoit.
  • This is on SUSE Linux Enterprise Server 11 (SP3). When IPv6 is disabled in the Network Settings in YaST, none of the network interfaces have IPv6 addresses (not even link-local or loopback addresses), and creating an object adapter on the wildcard host fails:
    test@su:~> python
    Python 2.6.8 (unknown, May 29 2012, 22:30:44) 
    [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Ice
    >>> cm = Ice.initialize()
    >>> ad = cm.createObjectAdapterWithEndpoints("test", "tcp -h *")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/tmp/lib/python/Ice.py", line 561, in createObjectAdapterWithEndpoints
        adapter = self._impl.createObjectAdapterWithEndpoints(name, endpoints)
    Ice.SocketException: Ice.SocketException:
    Address family not supported by protocol
    

    ...probably due to this failed syscall:
    socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
    
  • benoit
    benoit Rennes, France
    Hi,

    Thanks, I was also able to reproduce this on SLES. We'll look into fixing this for the next release!

    Cheers,
    Benoit.
  • Thanks! :)