Здравейте, имам някакъв проблем с получаването на информация за адреса на мрежовата карта от драйвера WinPcap. Забелязах, че всеки път, когато IPv6 е активиран за конкретен NIC, адресната информация за него става 0.0.0.0. Как мога да поправя това?
pcap_addr* address = GetDeviceAddress(1);
cout<<"IP address "<<iptos(((struct sockaddr_in *)address->addr)->sin_addr.s_addr)<<endl;
/////////////
pcap_addr* GetDeviceAddress(int index)//Gets the name of a device using the zero based index of its location in the list
{
int i=0;
if(pcap_findalldevs_ex(PCAP_SRC_IF_STRING,NULL,&AllDevices,errbuf) != -1)
for(Iterator=AllDevices;Iterator!=NULL;Iterator=Iterator->next)
{
if(i==index)
{
return Iterator->addresses;
}
i++;
}
return NULL;
}