Ignore:
Timestamp:
Aug 7, 2009, 10:06:04 AM (15 years ago)
Author:
Christoph Mayer
Message:

v6 address detection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/networkinfo/AddressDiscovery.cpp

    r5639 r5757  
    9797        struct ifaddrs* tmpAddr     = NULL;
    9898        void*           tmpAddrPtr  = NULL;
    99         char            straddr     [INET_ADDRSTRLEN];
    10099
    101100        int ret = getifaddrs( &ifaceBuffer );
     
    107106                if(i == NULL) continue;
    108107                struct sockaddr* addr = i->ifa_addr;
     108                if (addr==NULL) continue;
    109109
    110110                if (addr->sa_family == AF_INET) {
    111111                        // look for ipv4
    112                         if (addr==NULL) continue;
     112                        char straddr[INET_ADDRSTRLEN];
    113113                        tmpAddrPtr= &((struct sockaddr_in*)addr)->sin_addr;
    114114                        inet_ntop( i->ifa_addr->sa_family, tmpAddrPtr, straddr, sizeof(straddr) );
     
    120120                if (addr->sa_family == AF_INET6) {
    121121                        // look for ipv6
    122                         if (addr==NULL) continue;
     122                        char straddr[INET6_ADDRSTRLEN];
    123123                        tmpAddrPtr= &((struct sockaddr_in6*)addr)->sin6_addr;
    124124                        inet_ntop( i->ifa_addr->sa_family, tmpAddrPtr, straddr, sizeof(straddr) );
Note: See TracChangeset for help on using the changeset viewer.