From 0b80bffbcb4edc8e83c6f2bc147142cf5d45473d Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Tue, 22 May 2018 09:52:41 +0800 Subject: [PATCH] General/EnableLoopback is no longer useful and causes crashes when set to true, so eliminate it (marking the option as deprecated for now) Signed-off-by: Erik Boasson --- src/core/ddsi/src/q_config.c | 14 ++++++++++---- src/core/ddsi/src/q_ddsi_discovery.c | 7 +------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/core/ddsi/src/q_config.c b/src/core/ddsi/src/q_config.c index 6cb8435..3c3d2ed 100644 --- a/src/core/ddsi/src/q_config.c +++ b/src/core/ddsi/src/q_config.c @@ -194,6 +194,7 @@ DI(if_thread_properties); #define END_MARKER { NULL, NULL, NULL, NODATA, NULL } #define WILDCARD { "*", NULL, NULL, NODATA, NULL } #define LEAF(name) name, NULL, NULL +#define DEPRECATED_LEAF(name) "|" name, NULL, NULL #define LEAF_W_ATTRS(name, attrs) name, NULL, attrs #define GROUP(name, children) name, children, NULL, 1, NULL, 0, 0, 0, 0, 0, 0 #define GROUP_W_ATTRS(name, children, attrs) name, children, attrs, 1, NULL, 0, 0, 0, 0, 0, 0 @@ -243,7 +244,7 @@ static const struct cfgelem general_cfgelems[] = { "

This element allows selecting the transport to be used (udp, udp6, tcp, tcp6, raweth)

" }, { LEAF("EnableMulticastLoopback"), 1, "true", ABSOFF(enableMulticastLoopback), 0, uf_boolean, 0, pf_boolean, "

This element specifies whether DDSI2E allows IP multicast packets to be visible to all DDSI participants in the same node, including itself. It must be \"true\" for intra-node multicast communications, but if a node runs only a single DDSI2E service and does not host any other DDSI-capable programs, it should be set to \"false\" for improved performance.

" }, -{ LEAF("EnableLoopback"), 1, "false", ABSOFF(enableLoopback), 0, uf_boolean, 0, pf_boolean, +{ DEPRECATED_LEAF("EnableLoopback"), 1, "false", ABSOFF(enableLoopback), 0, uf_boolean, 0, pf_boolean, "

This element specifies whether DDSI packets are visible to all DDSI participants in the same process. It must be \"true\" for intra-process communications, i.e. a reader and writer communicating in the same address space. If enabled and using multicast then EnableMulticastLoopback must also be enabled.

" }, { LEAF("StartupModeDuration"), 1, "2 s", ABSOFF(startup_mode_duration), 0, uf_duration_ms_1hr, 0, pf_duration, "

This element specifies how long the DDSI2E remains in its \"startup\" mode. While in \"startup\" mode all volatile reliable data published on the local node is retained as-if it were transient-local data, allowing existing readers on remote nodes to obtain the data even though discovering them takes some time. Best-effort data by definition need not arrive, and transient and persistent data are covered by the durability service.

\n\ @@ -2462,9 +2463,14 @@ static int proc_elem_open(void *varg, UNUSED_ARG(uintptr_t parentinfo), UNUSED_A idx = matching_name_index(csename, name); #if WARN_DEPRECATED_ALIAS if ( idx > 0 ) { - int n = (int) (strchr(csename, '|') - csename); - if ( csename[n + 1] != '|' ) - cfg_warning(cfgst, "'%s': deprecated alias for '%*.*s'", name, n, n, csename); + if (csename[0] == '|') { + cfg_warning(cfgst, "'%s': deprecated setting", name); + } else { + int n = (int) (strchr(csename, '|') - csename); + if ( csename[n + 1] != '|' ) { + cfg_warning(cfgst, "'%s': deprecated alias for '%*.*s'", name, n, n, csename); + } + } } #endif if ( idx >= 0 ) { diff --git a/src/core/ddsi/src/q_ddsi_discovery.c b/src/core/ddsi/src/q_ddsi_discovery.c index 86617f4..bba97fb 100644 --- a/src/core/ddsi/src/q_ddsi_discovery.c +++ b/src/core/ddsi/src/q_ddsi_discovery.c @@ -595,7 +595,6 @@ static int handle_SPDP_alive (const struct receiver_state *rst, nn_wctime_t time return 1; } - if (!config.enableLoopback) { int islocal = 0; if (ephash_lookup_participant_guid (&datap->participant_guid)) @@ -1162,11 +1161,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, nn_plist_t *dat if (is_deleted_participant_guid (&ppguid, DPG_REMOTE)) E (" local dead pp?\n", err); - if - ( - (! config.enableLoopback) && - (ephash_lookup_participant_guid (&ppguid) != NULL) - ) + if (ephash_lookup_participant_guid (&ppguid) != NULL) E (" local pp?\n", err); if (is_builtin_entityid (datap->endpoint_guid.entityid, vendorid))