Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-153

Lookup of bind_addr with Util.getFirstNonLoopbackAddress() breaks compatibility

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.2.9
    • 2.2.9
    • None

      in 2.2.7 UDP used

      InetAddress.getLocalHost().getHostAddress()

      to lookup the default NIC. which works quite fine. 2.2.9 uses Util.getFirstNonLoopbackAddress() which is not the same. in our case it reports a NIC that is only virtual and not reachable from outside. To be more specific it takes the interface of an VMWare (vmnet1). I will attach the output of ifconfig to make things clear.

      If you do not want to change this pls at least add a proberty that enforces using of InetAddress.getLocalHost() optionally. Thus the following code in UDP

      if(bind_addr == null) {
      bind_addr=Util.getFirstNonLoopbackAddress();
      }
      if(bind_addr == null)
      bind_addr=InetAddress.getLocalHost();

      Which does not make much sense now (second if is never reached) should be cached to something like

      if(bind_addr == null && !useLocalHost) {
      bind_addr=Util.getFirstNonLoopbackAddress();
      }
      if(bind_addr == null)
      bind_addr=InetAddress.getLocalHost();

            rhn-engineering-bban Bela Ban
            greydeath_jira Michael Kopp (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: