[omniORB] tiny bug on vxworks

hide at yaskawa.co.jp hide at yaskawa.co.jp
Tue May 9 17:32:20 BST 2006




Hello,

I'm using great omniORB 4.0.x on vxworks 5.5.
I found a tiny bug for vxworks code at:

omniORB\src\lib\omniORB\orbcore\tcp\tcpTransportImpl.cc:
void vxworks_get_ifinfo(omnivector<const char*>& ifaddrs)

In above function, there are some code below:

  for (entryLength = ifc.ifc_len; entryLength > 0;) {
    offset = sizeof (ifr->ifr_name) + sizeof (ifr->ifr_addr);
    bcopy ((caddr_t)ifr, ifreqBuf, offset);

    if (ioctl (s, SIOCGIFFLAGS, (int)ifreqBuf) < 0) {
      if (omniORB::trace(1)) {
     omniORB::logger log;
     log << "Warning: ioctl SIOCGIFFLAGS failed. "
         << "Unable to obtain the list of all interface addresses.\n";
      }
      close (s);
      return;
    }

but I think it should be:

  for (entryLength = ifc.ifc_len; entryLength > 0;) {
    offset = sizeof (ifr->ifr_name) + ifr->ifr_addr.sa_len; /* here! */
    bcopy ((caddr_t)ifr, ifreqBuf, offset);

    if (ioctl (s, SIOCGIFFLAGS, (int)ifreqBuf) < 0) {
      if (omniORB::trace(1)) {
     omniORB::logger log;
     log << "Warning: ioctl SIOCGIFFLAGS failed. "
         << "Unable to obtain the list of all interface addresses.\n";
      }
      close (s);
      return;
    }

which works better.

Regards,
Hide





More information about the omniORB-list mailing list