[omniORB] AIX fails to detect all interfaces (patch incl)

Mark Zimmerman markzimm at frii.com
Fri Jun 13 15:17:13 BST 2003


Greetings:

The detection of interfaces under AIX is currently based on luck. On one
system, this happens:

omniORB: Distribution date: Fri Mar 14 11:27:17 GMT 2003 dgrisby
omniORB: My addresses are: 
omniORB: Initialising omniDynamic library.
omniORB: Current configuration is as follows:
( ... )
omniORB: No list of interface addresses; fall back to system hostname.

This is good luck, since you get an external interface that works. Note
that in this case, 'good luck' means it detects no interfaces.

On another system:

omniORB: Distribution date: Fri Mar 14 11:27:17 GMT 2003 dgrisby
omniORB: My addresses are: 
omniORB: 127.0.0.1
omniORB: Initialising omniDynamic library.
omniORB: Current configuration is as follows:
( ... )
omniORB: Warning: the local loop back interface (127.0.0.1) is used as
this server's address. Only clients on this machine can talk to
this server.

This is bad luck, since it detects the loopback address and you are
stuck with it.

The attached patch fixes the problem; apparently AIX prefers
OSIOCGIFCONF to SIOCGIFCONF in the ioctl.

-- Mark

-------------- next part --------------
Index: tcpTransportImpl.cc
===================================================================
RCS file: /cvsroot/omniorb/omni/src/lib/omniORB/orbcore/tcp/Attic/tcpTransportImpl.cc,v
retrieving revision 1.1.2.16
diff -u -r1.1.2.16 tcpTransportImpl.cc
--- tcpTransportImpl.cc 17 Feb 2003 02:03:11 -0000      1.1.2.16
+++ tcpTransportImpl.cc 13 Jun 2003 20:12:55 -0000
@@ -272,7 +272,11 @@
     char* buf = (char*) malloc(len);
     ifc.ifc_len = len;
     ifc.ifc_buf = buf;
+#ifdef __aix__
+    if ( ioctl(sock, OSIOCGIFCONF, &ifc) < 0 ) {
+#else
     if ( ioctl(sock, SIOCGIFCONF, &ifc) < 0 ) {
+#endif
       if ( errno != EINVAL || lastlen != 0 ) {
        if ( omniORB::trace(1) ) {
          omniORB::logger log;



More information about the omniORB-list mailing list