Bug 808415

Summary: cluster-url should provide only existing addresses
Product: Red Hat Enterprise MRG Reporter: Zdenek Kraus <zkraus>
Component: qpid-cppAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED NOTABUG QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 2.1CC: astitcher, jross
Target Milestone: 2.2   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-23 17:07:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zdenek Kraus 2012-03-30 11:01:20 UTC
Description of problem:
it's possible to specify cluster-url with address that broker doesn't know (address is not available on none of local interfaces). It could be mistake in address but address is syntax-correct, or address on interface was chanded by DHCP, etc..

Version-Release number of selected component (if applicable):
qpid-cpp-server-0.14-10.el6.x86_64
qpid-cpp-server-ssl-0.14-10.el6.x86_64
qpid-cpp-server-xml-0.14-10.el6.x86_64
qpid-cpp-server-store-0.14-10.el6.x86_64
qpid-cpp-server-devel-0.14-10.el6.x86_64
qpid-cpp-server-cluster-0.14-10.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. set up cluster-name and cluster-url to some localhost address in
/etc/qpidd.conf
cluster-name=mycluster
cluster-url=amqp:tcp:172.16.31.254
# address must not be on any interface
2. start openais/corosync for clustering and broker
3. run qpid-cluster and observe that address are provided as
URL
  
Actual results:
Cluster Name: mycluster
Cluster Status: ACTIVE
  Cluster Size: 1
       Members: ID=126.39.0.0:5693 URL=amqp:tcp:172.16.31.254:5672


Expected results:
qpidd fails with error message like: "address does not exists on any available interface, thus cannot be supplied in cluster-url"

or prints warning, and will not provide such address to clients if
there is some other correct addresss (Note that second result is subject of
disscution) 

Additional info:

Comment 1 Zdenek Kraus 2012-03-30 11:06:50 UTC
additional note, it should filter out address like 255.255.255.255 and 0.0.0.0, which is syntax-correct and also should be evaluated as existing because of their meaning.

Comment 2 Andrew Stitcher 2012-04-02 15:18:16 UTC
I'm not sure about this idea - I think that it may be impossible for the broker to determine all the addresses that could be used to allow clients to refer to it.

It seems to me that the address advertised to clients could be an address that is not actually attached to one of the network interfaces of the machine for a number of reasons (simple example would be NAT).

I think the only safe way to perform the check would be to try to contact the broker on the address and make sure it is actually you.

Comment 3 Zdenek Kraus 2012-04-03 09:27:49 UTC
NAT is good reason to provide locally non existing address.