Repository: qpid-dispatch
Updated Branches:
  refs/heads/master d965d9b1d -> 3b0bad143


DISPATCH-1198 - Ensure router addresses always use CLOSEST, even if first seen 
from a client.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/3b0bad14
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/3b0bad14
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/3b0bad14

Branch: refs/heads/master
Commit: 3b0bad1438167494ee88b1c8b755d1935fe5b51f
Parents: d965d9b
Author: Ted Ross <[email protected]>
Authored: Tue Dec 4 12:08:42 2018 -0500
Committer: Ted Ross <[email protected]>
Committed: Tue Dec 4 12:08:42 2018 -0500

----------------------------------------------------------------------
 .../modules/address_lookup_client/lookup_client.c            | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/3b0bad14/src/router_core/modules/address_lookup_client/lookup_client.c
----------------------------------------------------------------------
diff --git a/src/router_core/modules/address_lookup_client/lookup_client.c 
b/src/router_core/modules/address_lookup_client/lookup_client.c
index 924565e..afe363b 100644
--- a/src/router_core/modules/address_lookup_client/lookup_client.c
+++ b/src/router_core/modules/address_lookup_client/lookup_client.c
@@ -208,6 +208,14 @@ static qdr_address_t 
*qdr_lookup_terminus_address_CT(qdr_core_t       *core,
         *unavailable = true;
 
     if (!addr && create_if_not_found) {
+        //
+        // If the address is a router-class address, change treatment to 
closest.
+        //
+        qd_iterator_reset(iter);
+        if (qd_iterator_octet(iter) == (unsigned char) 
QD_ITER_HASH_PREFIX_ROUTER) {
+            treat = QD_TREATMENT_ANYCAST_CLOSEST;
+        }
+
         addr = qdr_address_CT(core, treat);
         if (addr) {
             qd_hash_insert(core->addr_hash, iter, addr, &addr->hash_handle);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to