Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-2239

Fix incorrect IP Address associated with containers

    Details

    • Type: Bug
    • Status: Done
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 1.0.2, 1.1 M1
    • Component/s: None
    • Labels:
      None

      Description

      The XD Container IP address displayed on both 'singlenode' and Distributed modes are incorrect both on Shell as well as Admin-UI.

      Example:
      Noticed IP address as 10.10.10.*

      Following function in RuntimeUtils could be flawed:

      public static String getIpAddress() {
      	try {
      		for(Enumeration<NetworkInterface> enumNic = NetworkInterface.getNetworkInterfaces();
      				enumNic.hasMoreElements();) {
      			NetworkInterface ifc = enumNic.nextElement();
      			if (ifc.isUp()) {
      				for (Enumeration<InetAddress> enumAddr = ifc.getInetAddresses();
      						enumAddr.hasMoreElements(); ) {
      					InetAddress address = enumAddr.nextElement();
      					if (address instanceof Inet4Address && !address.isLoopbackAddress()) {
      						return address.getHostAddress();
      					}
      				}
      			}
      		}
      	}
      	catch (IOException e) {
      		// ignore
      	}
      
      	return "unknown";
      }
      

        Attachments

          Activity

            People

            • Assignee:
              hillert Gunnar Hillert
              Reporter:
              sabby Sabby Anandan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: