[patch] omni::LibcWrapper::isip6addr("2001:db8::") is false

Marcin Cieslak saper at saper.info
Sun Feb 14 23:23:47 GMT 2016


Hello,

I am a complete beginner to omniORB. I have configured
nameService to be running on the FreeBSD server
with "InitRef = NameService=corbaname::m.saper.info".

m.saper.info has an A DNS record and the AAAA DNS record
"2a01:4f8:a0:7383::".

"nameclt list" failed to connect though:

Script started on Sun Feb 14 13:44:45 2016
command: nameclt list
omniORB: (0) 2016-02-14 13:44:45.944177: Version: 4.2.1
omniORB: (0) 2016-02-14 13:44:45.945044: Distribution date: Mon 28 Sep 12:14:23 BST 2015 dgrisby
omniORB: (0) 2016-02-14 13:44:45.945315: Skip link local address fe80::221:85ff:fec6:fb29 on interface re0.
omniORB: (0) 2016-02-14 13:44:45.945433: Skip link local address fe80::1 on interface lo0.
omniORB: (0) 2016-02-14 13:44:45.945567: My addresses are: 
omniORB: 213.239.217.105
omniORB: 2a01:4f8:a0:7383::
omniORB: 213.239.217.125
omniORB: 2a01:4f8:a0:7383::1001
omniORB: 2a01:4f8:a0:7383::1002
omniORB: 2a01:4f8:a0:7383::1003
omniORB: 2a01:4f8:a0:7383::1004
omniORB: 127.0.0.10
omniORB: 2a01:4f8:a0:7383::1005
omniORB: ::1
omniORB: 127.0.0.1
omniORB: (0) 2016-02-14 13:44:45.945779: Maximum supported GIOP version is 1.2
omniORB: (0) 2016-02-14 13:44:45.945904: Native char code sets: ISO-8859-1 UTF-8.
omniORB: (0) 2016-02-14 13:44:45.946049: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: (0) 2016-02-14 13:44:45.946125: Native wide char code sets: UTF-16.
omniORB: (0) 2016-02-14 13:44:45.946243: Transmission wide char code sets: UTF-16(1.2).
omniORB: (0) 2016-02-14 13:44:45.946318: Information: the omniDynamic library is not linked.
omniORB: (0) 2016-02-14 13:44:45.946790: Current configuration is as follows:
omniORB:   DefaultInitRef (file) = 
omniORB:   DefaultInitRef (args) = 
omniORB:   InitRef = NameService=corbaname::m.saper.info
omniORB:   abortOnInternalError = 0
omniORB:   abortOnNativeException = 0
omniORB:   acceptBiDirectionalGIOP = 0
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname = 
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientConnectTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   configFile = /usr/local/etc/omniORB.cfg
omniORB:   connectionWatchImmediate = 0
omniORB:   connectionWatchPeriod = 50000
omniORB:   copyValuesInLocalCalls = 1
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 0
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublish = addr
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   idleThreadTimeout = 10
omniORB:   immediateAddressSwitch = 0
omniORB:   inConScanPeriod = 180
omniORB:   lcdMode = 0
omniORB:   listenBacklog = 128
omniORB:   maxClientThreadPoolSize = 100
omniORB:   maxGIOPConnectionPerServer = 5
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 100
omniORB:   maxSocketRecv = 2147483647
omniORB:   maxSocketSend = 2147483647
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 120
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   resetTimeOutOnRetries = 0
omniORB:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   socketSendBuffer = -1
omniORB:   strictIIOP = 1
omniORB:   supportBootstrapAgent = 0
omniORB:   supportCurrent = 1
omniORB:   supportPerThreadTimeOut = 0
omniORB:   tcAliasExpand = 0
omniORB:   threadPerConnectionLowerLimit = 9000
omniORB:   threadPerConnectionPolicy = 1
omniORB:   threadPerConnectionUpperLimit = 10000
omniORB:   threadPoolWatchConnection = 1
omniORB:   throwTransientOnTimeOut = 0
omniORB:   traceExceptions = 1
omniORB:   traceFile = [stderr]
omniORB:   traceInvocationReturns = 0
omniORB:   traceInvocations = 1
omniORB:   traceLevel = 25
omniORB:   traceLocking = 0
omniORB:   traceThreadId = 1
omniORB:   traceTime = 1
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   validateUTF8 = 0
omniORB:   verifyObjectExistsAndType = 1
omniORB: (0) 2016-02-14 13:44:45.947235: Creating ref to remote: key<NameService>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: 
omniORB: (0) 2016-02-14 13:44:46.151415: Initial reference `NameService' resolved from configuration file.
omniORB: (0) 2016-02-14 13:44:46.151466: Invoke '_is_a' on remote: key<NameService>
omniORB: (0) 2016-02-14 13:44:46.151580: Resolve name 'm.saper.info'...
omniORB: (0) 2016-02-14 13:44:46.154065: Name 'm.saper.info' resolved to 2a01:4f8:a0:7383::
omniORB: (0) 2016-02-14 13:44:46.154133: throw TRANSIENT from giopRope.cc:256 (NO,TRANSIENT_NoUsableProfile)
omniORB: (0) 2016-02-14 13:44:46.154422: throw TRANSIENT from omniObjRef.cc:739 (NO,TRANSIENT_NoUsableProfile)
Caught a TRANSIENT exception when trying to validate the type of the 
NamingContext. Is the naming service running?
omniORB: (0) 2016-02-14 13:44:46.155107: ORB not destroyed; no final clean-up.

Script done on Sun Feb 14 13:44:46 2016


as it turns out, omni::LibcWrapper::isip6addr("2a01:4f8:a0:7383::") was returning false.

The following patch seems to fix this:

Index: libcWrapper.cc
===================================================================
--- libcWrapper.cc	(wersja 6316)
+++ libcWrapper.cc	(kopia robocza)
@@ -212,17 +212,11 @@
       return 0;
     }
   }
-  if (colons < 2 || colons > 7)
+  if (colons < 1 || colons > 7)
     return 0;
 
   if (bi == 0) {
     // No number at the end. Counts equivalent to ::
-    if (seen_blank) {
-      if (colons == 2)
-	return 1;
-      else
-	return 0;
-    }
     return 1;
   }
 

I am not sure if the "colons < 1" condition is proper, since
then isip6addr("2a01") is false, but isip6addr("2a01:")
is true. With "colons < 2" isip6addr("2a01:") is false,
but isip6addr("2a01:a:") is true.

There are no unit tests for this function so I am not sure
if there are no regressions there.


I also wonder if this function shouldn't accept zone indexed
addresses (fe80::3%iface) as well.


All the best,

Marcin Cieślak



More information about the omniORB-list mailing list