tcpdump mailing list archives

[Patch] fad-win32.c


From: Gisle Vanem <gvanem () broadpark no>
Date: Thu, 04 Apr 2013 10:20:48 +0200

This is a similar patch to the change of pcap-dos.c:
 https://github.com/mcr/libpcap/commit/73b5f0387199fbaa75130837b931faf770471640

I.e. the '_interfaces' suffix got lost in some other change to the puplic API.
(I don't know when). Since 'pcap_findalldevs()' is now a more generic version in pcap.c, the platform-specific function is called 'pcap_findalldevs_interfaces()' in fad-win32.c:

--- Git-Latest\fad-win32.c      Wed Nov 28 23:41:44 2012
+++ fad-win32.c     Wed Mar 27 16:14:02 2013
@@ -216,13 +216,13 @@
 * Win32 implementation, based on WinPcap
 */
int
-pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
+pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
{
       pcap_if_t *devlist = NULL;
       int ret = 0;
       const char *desc;
       char *AdaptersName;
-       ULONG NameLength;
+       ULONG NameLength = 0;
       char *name;

       if (!PacketGetAdapterNames(NULL, &NameLength))

-----

'NameLength = 0' is just in case 'PacketGetAdapterNames()' fails
w/o setting '*NameLength == 0'. It really could do that; ref. Packet32.c in WinPcap.

--gv
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Current thread: