[PATCH] fix getifaddrs() to set correct sin6_scope_id
Mitsuru KANDA / 神田 充
mk@karaba.org
Mon Oct 11 11:43:00 GMT 2004
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;
More information about the Libc-alpha
mailing list