wpcap: Avoid deprecated pcap_lookupdev().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0f37157bf9
commit
732d0db63b
|
@ -202,8 +202,18 @@ int CDECL wine_pcap_list_datalinks(pcap_t *p, int **dlt_buffer)
|
|||
|
||||
char* CDECL wine_pcap_lookupdev(char *errbuf)
|
||||
{
|
||||
static char *ret;
|
||||
pcap_if_t *devs;
|
||||
|
||||
TRACE("(%p)\n", errbuf);
|
||||
return pcap_lookupdev(errbuf);
|
||||
if (!ret)
|
||||
{
|
||||
if (pcap_findalldevs( &devs, errbuf ) == -1) return NULL;
|
||||
if (!devs) return NULL;
|
||||
if ((ret = heap_alloc( strlen(devs->name) + 1 ))) strcpy( ret, devs->name );
|
||||
pcap_freealldevs( devs );
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int CDECL wine_pcap_lookupnet(const char *device, unsigned int *netp, unsigned int *maskp,
|
||||
|
|
Loading…
Reference in New Issue