Ticket #11649: patch-inet.c

File patch-inet.c, 1.0 KB (added by matt@…, 18 years ago)

Patch for inet.c

Line 
1--- inet.c.orig 2007-03-28 13:25:52.000000000 +0800
2+++ inet.c      2007-03-28 13:29:41.000000000 +0800
3@@ -144,7 +144,21 @@
4         * on Solaris; we don't just omit loopback interfaces
5         * becaue you *can* capture on loopback interfaces on some
6         * OSes.
7+        *
8+        * On OS X, we don't do this check if the device
9+        * name begins with "wlt"; at least some versions
10+        * of OS X offer monitor mode capturing by having
11+        * a separate "monitor mode" device for each wireless
12+        * adapter, rather than by implementing the ioctls
13+        * that {Free,Net,Open,DragonFly}BSD provide.
14+        * Opening that device puts the adapter into monitor
15+        * mode, which, at least for some adapters, causes
16+        * them to deassociate from the network with which
17+        * they're associated.
18         */
19+#ifdef __APPLE__
20+       if (strncmp(name, "wlt", 3) != 0) {
21+#endif /* __APPLE */
22        p = pcap_open_live(name, 68, 0, 0, errbuf);
23        if (p == NULL) {
24                /*
25@@ -155,7 +169,9 @@
26                return (0);
27        }
28        pcap_close(p);
29-
30+#ifdef __APPLE__
31+       }
32+#endif
33        /*
34         * Is there already an entry in the list for this interface?
35         */