From dbb7a4c04275742cac32b61465c984dad7b1d91a Mon Sep 17 00:00:00 2001 From: Shailesh Mittal Date: Wed, 21 Apr 2004 18:18:58 +0000 Subject: [PATCH] Creating an IPv6 socket if AF_INET6 is defined on the system. If IPv6 2003-06-10 Shailesh Mittal * libuuid/gen_uuid.c (get_node_id): Creating an IPv6 socket if AF_INET6 is defined on the system. If IPv6 socket cannot be created, then we are falling back to IPv4 socket creation, as was done previously. --- NEWS | 7 +++++++ capplets/file-types/ChangeLog | 6 ++++++ capplets/file-types/libuuid/gen_uuid.c | 14 +++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 78fa187c4..73a5e9e09 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +gnome-control-center 2.7.0 + +Shailesh Mittal: + http://bugzilla.gnome.org/show_bug.cgi?id=114832 + * IPV6 support in the file types capplet + +------------------------------------------------------------------------------ gnome-control-center 2.6.1 Alex Larsson: diff --git a/capplets/file-types/ChangeLog b/capplets/file-types/ChangeLog index c90cbc2af..6942356a6 100644 --- a/capplets/file-types/ChangeLog +++ b/capplets/file-types/ChangeLog @@ -1,3 +1,9 @@ +2003-06-10 Shailesh Mittal + + * libuuid/gen_uuid.c (get_node_id): Creating an IPv6 socket if AF_INET6 + is defined on the system. If IPv6 socket cannot be created, then we are + falling back to IPv4 socket creation, as was done previously. + 2004-04-15 Jody Goldberg * Release 2.6.1 diff --git a/capplets/file-types/libuuid/gen_uuid.c b/capplets/file-types/libuuid/gen_uuid.c index 1b3b88105..0d08f356c 100644 --- a/capplets/file-types/libuuid/gen_uuid.c +++ b/capplets/file-types/libuuid/gen_uuid.c @@ -104,11 +104,19 @@ static int get_node_id(unsigned char *node_id) #else #define ifreq_size(i) sizeof(struct ifreq) #endif /* HAVE_SA_LEN*/ +#ifdef AF_INET6 + sd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_IP); - sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); - if (sd < 0) { - return -1; + /* If IPv6 fails then try with IPv4 socket. */ + if (sd < 0) +#endif + { + sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + if (sd < 0) { + return -1; + } } + memset(buf, 0, sizeof(buf)); ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf;