[jboss-jira] [JBoss JIRA] Created: (JGRP-739) check all bind_address against NetworkInterface.getByInetAddress() to see if it exists on the machine

Michael Newcomb (JIRA) jira-events at lists.jboss.org
Wed Apr 23 09:21:59 EDT 2008


check all bind_address against NetworkInterface.getByInetAddress() to see if it exists on the machine
-----------------------------------------------------------------------------------------------------

                 Key: JGRP-739
                 URL: http://jira.jboss.com/jira/browse/JGRP-739
             Project: JGroups
          Issue Type: Feature Request
            Reporter: Michael Newcomb
         Assigned To: Bela Ban
            Priority: Minor


Could you add a check in Util.getBindAddress() that checks the bind_addr against NetworkInterface.getByInetAddress() and throws some sort of exception if no NetworkInterface is returned?

I set my bind_addr via a database parameter and if the user mistakenly assigns the wrong bind address, it doesn't show up until UDP.createEphemeralDatagramSocket() when the localPort goes over 65535 because each attempt to create a DatagramSocket with the inet address that is not a local address throws a SocketException (actually a BindException) which is caught but ignored. When localPort finally goes over 65535 it throws an IllegalArgumentException.

So, a check in Util.getBindAddress() to see if the bind_addr is even available on the machine would lead to a failure in the configuration stage (setProperties).

As a side question, doesn't creating a DatagramSocket with port=0 guarantee an ephemeral port? Is it necessary to 'scan' for one? Perhaps a failure from the initial attempt with port=0 would wait a few ms and then try again with port=0?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list