This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]