JDK-6931566 : NetworkInterface is not working when interface name is more than 15 characters long
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6u18
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2010-03-03
  • Updated: 2014-04-16
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u22-revFixed 7 b102Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_18-ea"
Java(TM) SE Runtime Environment (build 1.6.0_18-ea-b05)
Java HotSpot(TM) Server VM (build 16.0-b12, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
SunOS 5.10 Generic_138888-06 sun4v sparc SUNW,Sun-Blade-T6320

A DESCRIPTION OF THE PROBLEM :
We are trying to use jdk1.6.0_18 with Weblogic 11gR1 (10.3.2).

The environment requires configuring a Virtual IP through Veritas Cluster into one of the Solaris 10 local zones.
As soon as the Virtual IP is plumbed in, the Weblogic server fails to come up and the following error is shown.

<BEA-000386> <Server subsystem failed. Reason: java.lang.AssertionError: An error occurred while retrieving the n
etwork addresses for this machine. The most likely cause is an error in the network configuration of this machine.
java.lang.AssertionError: An error occurred while retrieving the network addresses for this machine. The most likely cause is
an error in the network configuration of this machine.
at weblogic.server.channels.AddressUtils$AddressMaker.getAllAddresses(AddressUtils.java:89)
at weblogic.server.channels.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:47)
at weblogic.server.channels.AddressUtils.getLocalHost(AddressUtils.java:117)
at weblogic.cluster.ClusterHelper.getMachineName(ClusterHelper.java:44)
at weblogic.cluster.ClusterService.startService(ClusterService.java:102)
at weblogic.server.ServiceActivator.start(ServiceActivator.java:98)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

Caused By: java.net.SocketException: No such device or address
at java.net.NetworkInterface.getAll(Native Method)
at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:282)
at weblogic.server.channels.AddressUtils$AddressMaker.getAllAddresses(AddressUtils.java:57)
at weblogic.server.channels.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:47)
at weblogic.server.channels.AddressUtils.getLocalHost(AddressUtils.java:117)
at weblogic.cluster.ClusterHelper.getMachineName(ClusterHelper.java:44)
at weblogic.cluster.ClusterService.startService(ClusterService.java:102)
at weblogic.server.ServiceActivator.start(ServiceActivator.java:98)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

The issue has been found to be with one of the core jdk methods...

public static void main(String args[]) throws Exception {
Enumeration niEnum = NetworkInterface.getNetworkInterfaces();


This method fails whenever there is a Virtual IP plumbed into the Solaris container with jdk1.6
The server is able to start without any exception on the container IP as soon as the VIP is unplumbed.

So getNetworkInterfaces is not able to report back Virtual IP addresses on the local zones.


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION The NetworkInterface implementation uses ifreq structure to enumerate interfaces but the length of ifname field is limited to 15 chars by the OS and if an interface has the longer name it's truncated. see /usr/include/net/if.h: struct ifreq { #define IFNAMSIZ 16 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ ........ Example: 'e1000g1174004:27' gets truncated to 'e1000g1174004:2' (missing the trailing '7')
08-04-2010

PUBLIC COMMENTS 1) Can you please get the output of 'ifconfig -a' from the zone in which the problem occurs? 2) Can you please clarify what is meant by 'local zone'. Is this the global zone, or is it a non-global zone?
03-03-2010