From 9ee42c9509d01bb8e888c8cc1aa944312d7e88e7 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 17 Sep 2004 20:38:27 -0400 Subject: [PATCH] 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) --- lib/uuid/ChangeLog | 6 ++++++ lib/uuid/gen_uuid.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/uuid/ChangeLog b/lib/uuid/ChangeLog index e7b5bb1..21b5319 100644 --- a/lib/uuid/ChangeLog +++ b/lib/uuid/ChangeLog @@ -1,3 +1,9 @@ +2004-09-17 Theodore Ts'o + + * 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 * uuid.h (UUID_DEFINE): Make the UUID defined as a static diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c index 30d6202..42942aa 100644 --- a/lib/uuid/gen_uuid.c +++ b/lib/uuid/gen_uuid.c @@ -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]) -- 1.8.3.1