[omniORB] Some questions

jon.kristensen@kongsberg-simrad.com jon.kristensen@kongsberg-simrad.com
Mon, 29 Apr 2002 11:45:08 +0200


Hi,

Just tried to build the ETS config of omniORB 4 beta 1 (probably the only
user of that config :-)), and found a small typo in <top>
\src\lib\omniORB\orbcore\tcp\tcpTransportImpl.cc, line 311

      #define WSAIoctl ETS_ESAIoctl

      should read

     #define WSAIoctl ETS_WSAIoctl

There has been a bug report regarding WSAIoclt - SIO_ADDRESS_LIST_QUERY
under NT4.0, and the fix is supposed to be using SIO_GET_INTERFACE_LIST
instead. I got it working, but is this fix going in permanently?

Also, the code in tcpEndpoint.cc has changed a lot just before the Beta1
release, and no longer work in my configuration. I do not have a DNS
running, and  gethostbyname() thus fails. Also, I am a little puzzled by
the latest changes. I expect the call to
giopTransportImpl::getInterfaceAddress("giop:tcp") to return a list of IP
address strings, and do not see why you need to do DNS lookup on these.

I carved out a workaround as follows (in LibcWrapper.cpp, gethostbyname()):

  struct hostent myhp;   // need to be outside if statment block
  if ((hp = ::gethostbyname(name)) == NULL)
  {
    rc = WSAGetLastError();
    if (rc != WSANO_RECOVERY)
    {
      non_reentrant.unlock();
      return -1;
    }

    // May not have DNS running
    unsigned long addr = inet_addr(name);
    if (addr == INADDR_NONE)
    {
      rc = WSAGetLastError();
      non_reentrant.unlock();
      return -1;
    }

    // Fake a hostent structure based on our IP address
    char * Aliases[1] = { NULL };
    unsigned long * Adresses[2] = { &addr, NULL };

    hp = &myhp;
    hp->h_name     = (char*)name;
    hp->h_aliases   = (char**)Aliases;
    hp->h_addrtype  = PF_INET;
    hp->h_length    = 4;
    hp->h_addr_list = (char**)Adresses;
  }

This seems to do the trick for me (WIN32).

Regards,

Jon.

--------------
Jon Kristensen
Principal Engineer, SW Embedded Systems
Kongsberg Simrad AS, Horten, Norway
phone:    +47 33 02 39 34
fax: +47 33 04 76 19
email:    jon.kristensen@kongsberg-simrad.com