This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] fix getifaddrs() to set correct sin6_scope_id
- From: Mitsuru KANDA / 神田 充<mk at karaba dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 11 Oct 2004 16:12:05 +0900
- Subject: [PATCH] fix getifaddrs() to set correct sin6_scope_id
Hello,
The current getifaddrs() doesn't set correct sin6_scope_id value.
(You can verify it by using getnameinfo().)
The patch is below:
regards,
-mk
--- glibc-2.3.2/sysdeps/unix/sysv/linux/ifaddrs.c.org 2004-09-22 11:34:37.000000000 +0900
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/ifaddrs.c 2004-09-22 11:35:17.000000000 +0900
@@ -590,7 +590,7 @@
if (IN6_IS_ADDR_LINKLOCAL (rta_data)
|| IN6_IS_ADDR_MC_LINKLOCAL (rta_data))
((struct sockaddr_in6 *) sa)->sin6_scope_id
- = ifam->ifa_scope;
+ = ifam->ifa_index;
}
break;
@@ -637,7 +637,7 @@
if (IN6_IS_ADDR_LINKLOCAL (rta_data) ||
IN6_IS_ADDR_MC_LINKLOCAL (rta_data))
ifas[ifa_index].addr.s6.sin6_scope_id =
- ifam->ifa_scope;
+ ifam->ifa_index;
}
break;
@@ -678,7 +678,7 @@
if (IN6_IS_ADDR_LINKLOCAL (rta_data)
|| IN6_IS_ADDR_MC_LINKLOCAL (rta_data))
ifas[ifa_index].broadaddr.s6.sin6_scope_id
- = ifam->ifa_scope;
+ = ifam->ifa_index;
}
break;