]> The Tcpdump Group git mirrors - libpcap/commitdiff
Some fixes for the new API.
authorGuy Harris <[email protected]>
Sat, 21 Jan 2017 02:59:52 +0000 (18:59 -0800)
committerGuy Harris <[email protected]>
Sat, 21 Jan 2017 02:59:52 +0000 (18:59 -0800)
Save the result of the add_dev() call, so that the "#if 0" code could be
made to work.  (If it can't be made to work, it should be removed, along
with the curdev variable and the assignment to it.)

Don't pass dev->flags to add_dev(), as that routine expects PCAP_IF_
flags, not IFF_ flags - and we don't have the relevant IFF_ flags anyway
(IFF_UP, IFF_RUNNING, IFF_LOOPBACK if that applies).

pcap-dos.c

index 20428547e5242ba256a0679241754d638759e03b..457db72a6a94c38690c0c5b90e1039c95ef6011c 100644 (file)
@@ -544,6 +544,7 @@ int pcap_lookupnet (const char *device, bpf_u_int32 *localnet,
 int pcap_platform_finddevs  (pcap_if_list_t *devlistp, char *errbuf)
 {
   struct device     *dev;
+  pcap_if_t *curdev;
 #if 0   /* Pkt drivers should have no addresses */
   struct sockaddr_in sa_ll_1, sa_ll_2;
   struct sockaddr   *addr, *netmask, *broadaddr, *dstaddr;
@@ -562,8 +563,11 @@ int pcap_platform_finddevs  (pcap_if_list_t *devlistp, char *errbuf)
     FLUSHK();
     (*dev->close) (dev);
 
-    if (add_dev(devlistp, dev->name, dev->flags,
-                dev->long_name, errbuf) == NULL)
+    /*
+     * XXX - find out whether it's up or running?  Does that apply here?
+     */
+    if ((curdev = add_dev(devlistp, dev->name, 0,
+                dev->long_name, errbuf)) == NULL)
     {
       ret = -1;
       break;