Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 9888dbefb -> e565645ff


DISPATCH-1053 - Add router-control link constraint for addresses on received 
deliveries.


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

Branch: refs/heads/master
Commit: e565645ff0fa9eb661d1c2c37b3ca0f84e6317df
Parents: 9888dbe
Author: Ted Ross <tr...@redhat.com>
Authored: Wed Jun 27 13:26:11 2018 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed Jun 27 13:26:11 2018 -0400

----------------------------------------------------------------------
 src/router_core/route_tables.c        |  6 ++++++
 src/router_core/router_core_private.h |  1 +
 src/router_core/transfer.c            | 13 +++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e565645f/src/router_core/route_tables.c
----------------------------------------------------------------------
diff --git a/src/router_core/route_tables.c b/src/router_core/route_tables.c
index 6a1ae57..2f7dd54 100644
--- a/src/router_core/route_tables.c
+++ b/src/router_core/route_tables.c
@@ -232,6 +232,12 @@ void qdr_route_table_setup_CT(qdr_core_t *core)
         core->router_addr_T   = qdr_add_local_address_CT(core, 'T', 
"qdrouter",    QD_TREATMENT_MULTICAST_FLOOD);
         core->routerma_addr_T = qdr_add_local_address_CT(core, 'T', 
"qdrouter.ma", QD_TREATMENT_MULTICAST_ONCE);
 
+        core->hello_addr->router_control_only      = true;
+        core->router_addr_L->router_control_only   = true;
+        core->routerma_addr_L->router_control_only = true;
+        core->router_addr_T->router_control_only   = true;
+        core->routerma_addr_T->router_control_only = true;
+
         core->neighbor_free_mask = qd_bitmask(1);
 
         core->routers_by_mask_bit       = NEW_PTR_ARRAY(qdr_node_t, 
qd_bitmask_width());

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e565645f/src/router_core/router_core_private.h
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_private.h 
b/src/router_core/router_core_private.h
index cd2ffa4..b6775c7 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -456,6 +456,7 @@ struct qdr_address_t {
     int                        ref_count;     ///< Number of link-routes + 
auto-links referencing this address
     bool                       block_deletion;
     bool                       local;
+    bool                       router_control_only; ///< If set, address is 
only for deliveries arriving on a control link
     uint32_t                   tracked_deliveries;
     uint64_t                   cost_epoch;
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e565645f/src/router_core/transfer.c
----------------------------------------------------------------------
diff --git a/src/router_core/transfer.c b/src/router_core/transfer.c
index 184cda6..7729a8e 100644
--- a/src/router_core/transfer.c
+++ b/src/router_core/transfer.c
@@ -997,9 +997,18 @@ static void qdr_link_deliver_CT(qdr_core_t *core, 
qdr_action_t *action, bool dis
         }
 
         //
-        // Give the action reference to the qdr_link_forward function. Don't 
decref/incref.
+        // Deal with any delivery restrictions for this address.
         //
-        qdr_link_forward_CT(core, link, dlv, addr, more);
+        if (addr && addr->router_control_only && link->link_type != 
QD_LINK_CONTROL) {
+            qdr_delivery_release_CT(core, dlv);
+            qdr_link_issue_credit_CT(core, link, 1, false);
+            qdr_delivery_decref_CT(core, dlv, "qdr_link_deliver_CT - removed 
from action on restricted access");
+        } else {
+            //
+            // Give the action reference to the qdr_link_forward function. 
Don't decref/incref.
+            //
+            qdr_link_forward_CT(core, link, dlv, addr, more);
+        }
     } else {
         //
         // Take the action reference and use it for undelivered.  Don't 
decref/incref.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to