Bug 808396

Summary: cluster-url should not allow localhost addresses
Product: Red Hat Enterprise MRG Reporter: Zdenek Kraus <zkraus>
Component: qpid-cppAssignee: messaging-bugs <messaging-bugs>
Status: NEW --- QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.1CC: jross
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zdenek Kraus 2012-03-30 10:30:19 UTC
Description of problem:
option cluster-url allows to specify failover address localhost that tells client to failover to his localhost and that is not right.

all localhost variants are allowed:

    tcp:127.0.0.1:5672
    tcp:localhost:5672
    tcp:[::1]:5672
    tcp:localhost6:5672
    tcp:127.1:5672 

Domain name resolution may be done for Names like "localhost.localdomain", which could be specified by /etc/hosts. 

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:127.0.0.1:5672,tcp:localhost:5672,tcp:[::1]:5671,tcp:localhost6,tcp:127.1
2. start openais/corosync for clustering and broker
3. run qpid-cluster and observer that all localhost addresses are provided as URL
  
Actual results:
  Cluster Name: mycluster
Cluster Status: ACTIVE
  Cluster Size: 1
       Members: ID=126.39.0.0:5500 URL=amqp:tcp:127.0.0.1:5672,tcp:localhost:5672,tcp:[::1]:5671,tcp:localhost6:5672,tcp:127.1:5672


Expected results:
qpidd fails with error message like: "Localhost addresses is not allowed for cluster-url"

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

Additional info: