In some cases, pcap_findalldevs_ex needs the correct source to find local devices

This commit is contained in:
goldsimon 2010-07-05 14:10:07 +00:00
parent c932196e11
commit 90d5a61e85
1 changed files with 2 additions and 1 deletions

View File

@ -18,10 +18,11 @@ get_adapter_index_from_addr(struct in_addr *netaddr, char *guid, size_t guid_len
pcap_if_t *alldevs;
pcap_if_t *d;
char errbuf[PCAP_ERRBUF_SIZE+1];
char source[PCAP_ERRBUF_SIZE+1];
char source[] = "rpcap://";
int index = 0;
memset(guid, 0, guid_len);
memset(errbuf, 0, sizeof(errbuf));
/* Retrieve the interfaces list */
if (pcap_findalldevs_ex(source, NULL, &alldevs, errbuf) == -1) {