Ignore:
Timestamp:
Dec 8, 2009 4:53:29 PM (15 years ago)
Author:
bennylp
Message:

Fixed ticket #1000: IPv6 interface enumeration fails due to typo error in Windows targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ip_helper_win32.c

    r3002 r3029  
    4545                                           PULONG pdwSize,  
    4646                                           BOOL bOrder); 
    47 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    4847typedef DWORD (WINAPI *PFN_GetAdapterAddresses)(ULONG Family, 
    4948                                                ULONG Flags, 
     
    5150                                                PIP_ADAPTER_ADDRESSES AdapterAddresses, 
    5251                                                PULONG SizePointer); 
    53 #endif  /* PJ_HAS_IPV6 */ 
    5452typedef DWORD (WINAPI *PFN_GetIpForwardTable)(PMIB_IPFORWARDTABLE pIpForwardTable, 
    5553                                              PULONG pdwSize,  
     
    5957static HANDLE s_hDLL; 
    6058static PFN_GetIpAddrTable s_pfnGetIpAddrTable; 
    61 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    62     static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; 
    63 #endif  /* PJ_HAS_IPV6 */ 
     59static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; 
    6460static PFN_GetIpForwardTable s_pfnGetIpForwardTable; 
    6561static PFN_GetIfEntry s_pfnGetIfEntry; 
     
    7369    s_pfnGetIpForwardTable = NULL; 
    7470    s_pfnGetIfEntry = NULL; 
    75 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    7671    s_pfnGetAdapterAddresses = NULL; 
    77 #endif 
    7872} 
    7973 
     
    109103} 
    110104 
    111 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    112105static DWORD MyGetAdapterAddresses(ULONG Family, 
    113106                                   ULONG Flags, 
     
    118111    if(NULL == s_pfnGetAdapterAddresses) { 
    119112        s_pfnGetAdapterAddresses = (PFN_GetAdapterAddresses)  
    120             GetIpHlpApiProc("GetAdapterAddresses"); 
     113            GetIpHlpApiProc("GetAdaptersAddresses"); 
    121114    } 
    122115     
     
    128121    return ERROR_NOT_SUPPORTED; 
    129122} 
    130 #endif  /* PJ_HAS_IPV6 */ 
    131123 
    132124#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     
    231223 * which works for both IPv4 and IPv6. 
    232224 */ 
    233 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    234225static pj_status_t enum_ipv4_ipv6_interface(int af, 
    235226                                            unsigned *p_cnt, 
    236227                                            pj_sockaddr ifs[]) 
    237228{ 
    238     pj_uint8_t buffer[1024]; 
     229    pj_uint8_t buffer[1600]; 
    239230    IP_ADAPTER_ADDRESSES *adapter = (IP_ADAPTER_ADDRESSES*)buffer; 
    240231    ULONG size = sizeof(buffer); 
     
    252243    } 
    253244 
     245    *p_cnt = i; 
    254246    return PJ_SUCCESS; 
    255247} 
    256 #endif 
    257248 
    258249 
     
    270261                     PJ_EAFNOTSUP); 
    271262 
    272 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 
    273263    status = enum_ipv4_ipv6_interface(af, p_cnt, ifs); 
    274264    if (status != PJ_SUCCESS && (af==PJ_AF_INET || af==PJ_AF_UNSPEC)) 
    275265        status = enum_ipv4_interface(p_cnt, ifs); 
    276266    return status; 
    277 #else 
    278     if (af==PJ_AF_INET6) 
    279         return PJ_EIPV6NOTSUP; 
    280     else if (af != PJ_AF_INET && af != PJ_AF_UNSPEC) 
    281         return PJ_EAFNOTSUP; 
    282  
    283     status = enum_ipv4_interface(p_cnt, ifs); 
    284     return status; 
    285 #endif 
    286267} 
    287268 
Note: See TracChangeset for help on using the changeset viewer.