You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2019/06/11 18:34:08 UTC
[qpid-dispatch] branch master updated: DISPATCH-1362 - Remove
recursive call to qdr_check_addr_CT during core shutdown. This removes a
window of opportunity for an invalid free during shutdown. This closes #519
This is an automated email from the ASF dual-hosted git repository.
tross pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 2d42c9c DISPATCH-1362 - Remove recursive call to qdr_check_addr_CT during core shutdown. This removes a window of opportunity for an invalid free during shutdown. This closes #519
2d42c9c is described below
commit 2d42c9c645934332f1e5262fa4fa1a1cf9a30a37
Author: Ted Ross <tr...@redhat.com>
AuthorDate: Mon Jun 10 16:05:37 2019 -0400
DISPATCH-1362 - Remove recursive call to qdr_check_addr_CT during core shutdown. This removes a window of opportunity for an invalid free during shutdown.
This closes #519
---
src/router_core/connections.c | 8 ++++++++
src/router_core/router_core.c | 9 ++++++---
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index 01f4175..e62e609 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -1173,7 +1173,15 @@ void qdr_check_addr_CT(qdr_core_t *core, qdr_address_t *addr)
&& addr->tracked_deliveries == 0
&& addr->core_endpoint == 0
&& addr->fallback_for == 0) {
+ qdr_address_t *fallback = addr->fallback;
qdr_core_remove_address(core, addr);
+
+ //
+ // If the address being removed had a fallback address, check to see if that
+ // address should now also be removed.
+ //
+ if (!!fallback)
+ qdr_check_addr_CT(core, fallback);
}
}
diff --git a/src/router_core/router_core.c b/src/router_core/router_core.c
index aaab696..67c145e 100644
--- a/src/router_core/router_core.c
+++ b/src/router_core/router_core.c
@@ -519,10 +519,13 @@ void qdr_core_remove_address(qdr_core_t *core, qdr_address_t *addr)
cr = DEQ_HEAD(addr->conns);
}
- if (!!addr->fallback) {
+ //
+ // If there are any fallback-related linkages, disconnect them.
+ //
+ if (!!addr->fallback)
addr->fallback->fallback_for = 0;
- qdr_check_addr_CT(core, addr->fallback);
- }
+ if (!!addr->fallback_for)
+ addr->fallback_for->fallback = 0;
free(addr->add_prefix);
free(addr->del_prefix);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org