Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
Bug 998 - Wrong local host address determined on multihomed hosts
Summary: Wrong local host address determined on multihomed hosts
Status: RESOLVED FIXED
Alias: None
Product: JacORB
Classification: Unclassified
Component: ORB (show other bugs)
Version: 3.5
Hardware: PC Windows NT
: P5 major
Assignee: Mailinglist to track bugs
URL:
Depends on:
Blocks:
 
Reported: 2014-11-12 06:09 UTC by Jens Vagts
Modified: 2014-12-03 03:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Vagts 2014-11-12 06:09:06 UTC
Due to a enhancement within jacorb 3.5 (see here: https://github.com/JacORB/JacORB/commit/bcb220ba117e5a4ce9978d8008ab173244975067) the order of IPv4 addresses deliverd by the system gets reversed!
Since the new logic uses addFirst() instead of simply add(), the last IPv4 address/network adapter gets the first in the resulting list. The as primary the method org.jacorb.orb.iiop.IIOPAddress.getLocalHost() uses the first address of this list (which is the last in the system).
Comment 1 Nick Cross 2014-11-12 06:32:14 UTC
Can you run ifconfig to show your OS config and also run org.jacorb.util.Diagnostic ?
Comment 2 Jens Vagts 2014-11-12 07:14:29 UTC
ipconfig:
=========
Windows IP Configuration


Ethernet adapter Hausnetz:

   Connection-specific DNS Suffix  . : mydomain.de
   IPv4 Address. . . . . . . . . . . : 10.49.4.111
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.49.4.1

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::50f2:5478:714d:ae6f%14
   IPv4 Address. . . . . . . . . . . : 192.168.42.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::8166:4bd9:927c:cf6f%15
   IPv4 Address. . . . . . . . . . . : 192.168.88.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::844c:5d4e:144f:868b%18
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :


org.jacorb.util.Diagnostic:
===========================
JacORB Version: JacORB V3.5 (www.jacorb.org)
        (C) The JacORB project 1997-2014
        11 July 2014 with SHA 0620c4ad

Operating system name: Windows 7
Operating system version: 6.1
Operating system architecture: amd64
Java Vendor: Oracle Corporation
Java Version: 1.7.0_71
Runtime max memory: 2731M

Found the following network addresses:
    /192.168.56.1 / mycomputer.mydomain.de
    /192.168.88.1 / mycomputer.mydomain.de
    /192.168.42.1 / mycomputer.mydomain.de
    /10.49.4.111 / mycomputer.mydomain.de
    /fe80:0:0:0:0:5efe:c0a8:3801%17 / fe80:0:0:0:0:5efe:c0a8:3801%17
    /fe80:0:0:0:0:5efe:c0a8:5801%13 / fe80:0:0:0:0:5efe:c0a8:5801%13
    /fe80:0:0:0:0:5efe:c0a8:2a01%12 / fe80:0:0:0:0:5efe:c0a8:2a01%12
    /fe80:0:0:0:0:5efe:a31:46f%11 / fe80:0:0:0:0:5efe:a31:46f%11
    /127.0.0.1 / 127.0.0.1
    /0:0:0:0:0:0:0:1 / 0:0:0:0:0:0:0:1
    /fe80:0:0:0:50f2:5478:714d:ae6f%14 / mycomputer.mydomain.de
    /fe80:0:0:0:8166:4bd9:927c:cf6f%15 / mycomputer.mydomain.de
    /fe80:0:0:0:844c:5d4e:144f:868b%18 / mycomputer.mydomain.de
Preferred non-loopback address /192.168.56.1

Default locale en_US (which is English (United States))
System file encoding property: Cp1252
Cannonical encoding: Cp1252
Default WChar encoding: UTF16

INFO Initialising ORB with ID:
WARNING Warning - unknown codeset (Cp1252) - defaulting to ISO-8859-1
INFO InterceptorManager started with 0 Server Interceptors, 0 Client Interceptors and 1 IOR Interceptors
Created ORB org.jacorb.orb.ORB

===========================
As you can see: the order of adapters is reversed and the main issue for me: the primary/preferred IP address becomes a virtual network adapter resulting is corba objects bound to this wrong/internal address.
Comment 3 Nick Cross 2014-12-03 03:43:09 UTC
Fixed by SHA 74373300a84ad72e32cc920d2d4eab28db90f88c

Thanks to Jens for lots of help debugging and running multiple custom builds to test the fix!