]> The Tcpdump Group git mirrors - libpcap/blobdiff - inet.c
Another change from Debian.
[libpcap] / inet.c
diff --git a/inet.c b/inet.c
index 8adf18d11c9a86fdfa25ded9dc6cd616af4902d1..aad87963e78684ca00a5ce98325e09e7140958c3 100644 (file)
--- a/inet.c
+++ b/inet.c
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.75.2.1 2008-04-17 18:58:03 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.75.2.4 2008-04-20 18:19:24 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -366,8 +366,29 @@ add_or_find_if(pcap_if_t **curdev_ret, pcap_if_t **alldevs, const char *name,
  * a Cisco 340 or 350, rather than an old Aironet card, it should use
  * that in the description.
  *
- * Do NetBSD, DragonflyBSD, or OpenBSD support this as well?
- * Do any other UN*Xes support getting a description?
+ * Do NetBSD, DragonflyBSD, or OpenBSD support this as well?  OpenBSD
+ * lets you get a description, but it's not generated by the OS, it's
+ * set with another ioctl that ifconfig supports; we use that to get
+ * the description in OpenBSD.
+ *
+ * In OS X, the System Configuration framework can apparently return
+ * names in 10.4 and later; it also appears that freedesktop.org's HAL
+ * offers an "info.product" string, but the HAL specification says
+ * it "should not be used in any UI" and "subsystem/capability
+ * specific properties" should be used instead.  Using that would
+ * require that libpcap applications be linked with the frameworks/
+ * libraries in question, which would be a bit of a pain unless we
+ * offer, for example, a pkg-config:
+ *
+ *     http://pkg-config.freedesktop.org/wiki/
+ *
+ * script, so applications can just use that script to find out what
+ * libraries you need to link with when linking with libpcap.
+ * pkg-config is GPLed; I don't know whether that would prevent its
+ * use with a BSD-licensed library such as libpcap.
+ *
+ * Do any other UN*Xes, or desktop environments support getting a
+ * description?
  */
 int
 add_addr_to_iflist(pcap_if_t **alldevs, const char *name, u_int flags,
@@ -392,7 +413,7 @@ add_addr_to_iflist(pcap_if_t **alldevs, const char *name, u_int flags,
         */
        memset(&ifrdesc, 0, sizeof ifrdesc);
        strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
-       ifrdesc.ifr_data = (caddr_t)&ifrdesc;
+       ifrdesc.ifr_data = (caddr_t)&ifdescr;
        s = socket(AF_INET, SOCK_DGRAM, 0);
        if (s >= 0) {
                if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0 &&