Whamcloud - gitweb
gen_uuid.c (get_node_id): glibc always defines AF_LINK, so only
authorTheodore Ts'o <tytso@mit.edu>
Sat, 18 Sep 2004 00:38:27 +0000 (20:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 18 Sep 2004 00:38:27 +0000 (20:38 -0400)
try to use struct sockaddr_dl if HAVE_NET_IF_DL_H is
defined.  (Addresses Debian Bug #256669)

lib/uuid/ChangeLog
lib/uuid/gen_uuid.c

index e7b5bb1..21b5319 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-17  Theodore Ts'o  <tytso@mit.edu>
+
+       * gen_uuid.c (get_node_id): glibc always defines AF_LINK, so only
+               try to use struct sockaddr_dl if HAVE_NET_IF_DL_H is
+               defined.  (Addresses Debian Bug #256669)
+
 2004-05-27  Theodore Ts'o  <tytso@mit.edu>
 
        * uuid.h (UUID_DEFINE): Make the UUID defined as a static
index 30d6202..42942aa 100644 (file)
@@ -143,7 +143,7 @@ static int get_node_id(unsigned char *node_id)
        char buf[1024];
        int             n, i;
        unsigned char   *a;
-#ifdef AF_LINK
+#ifdef HAVE_NET_IF_DL_H
        struct sockaddr_dl *sdlp;
 #endif
 
@@ -188,7 +188,7 @@ static int get_node_id(unsigned char *node_id)
                        continue;
                a = (unsigned char *) ifr.ifr_enaddr;
 #else
-#ifdef AF_LINK
+#ifdef HAVE_NET_IF_DL_H
                sdlp = (struct sockaddr_dl *) &ifrp->ifr_addr;
                if ((sdlp->sdl_family != AF_LINK) || (sdlp->sdl_alen != 6))
                        continue;
@@ -200,7 +200,7 @@ static int get_node_id(unsigned char *node_id)
                 */
                close(sd);
                return 0;
-#endif /* AF_LINK */
+#endif /* HAVE_NET_IF_DL_H */
 #endif /* SIOCGENADDR */
 #endif /* SIOCGIFHWADDR */
                if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5])