7123415: Some cases of network interface indexes being read incorrectly
Reviewed-by: chegar
Contributed-by: brandon.passanisi@oracle.com
--- a/jdk/src/solaris/native/java/net/net_util_md.c Mon Jan 09 20:14:15 2012 -0800
+++ b/jdk/src/solaris/native/java/net/net_util_md.c Tue Jan 10 10:57:12 2012 +0000
@@ -588,7 +588,7 @@
int plen, scope, dad_status, if_idx;
if ((f = fopen("/proc/net/if_inet6", "r")) != NULL) {
- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
+ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&if_idx, &plen, &scope, &dad_status, devname) == 13) {
@@ -1078,7 +1078,7 @@
int plen, scope, dad_status, if_idx;
if ((f = fopen("/proc/net/if_inet6", "r")) != NULL) {
- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
+ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&if_idx, &plen, &scope, &dad_status, devname) == 13) {