diff --git a/src/core/ddsi/include/dds/ddsi/q_config.h b/src/core/ddsi/include/dds/ddsi/q_config.h index 50ceb51..08f3d6e 100644 --- a/src/core/ddsi/include/dds/ddsi/q_config.h +++ b/src/core/ddsi/include/dds/ddsi/q_config.h @@ -331,7 +331,6 @@ struct config enum besmode besmode; int conservative_builtin_reader_startup; int meas_hb_to_ack_latency; - int suppress_spdp_multicast; int unicast_response_to_spdp_messages; int synchronous_delivery_priority_threshold; int64_t synchronous_delivery_latency_bound; diff --git a/src/core/ddsi/src/q_config.c b/src/core/ddsi/src/q_config.c index 6c22b64..39ae17b 100644 --- a/src/core/ddsi/src/q_config.c +++ b/src/core/ddsi/src/q_config.c @@ -245,7 +245,7 @@ static const struct cfgelem general_cfgelems[] = {
It is a comma-separated list of some of the following keywords: \"spdp\", \"asm\", \"ssm\", or either of \"false\" or \"true\".
\n\When set to \"false\" all multicasting is disabled. The default, \"true\" enables full use of multicasts. Listening for multicasts can be controlled by General/MulticastRecvNetworkInterfaceAddresses.
") }, @@ -531,9 +531,6 @@ static const struct cfgelem unsupp_cfgelems[] = {Should it be necessary to hide DDSI2E's shared discovery behaviour, set this to true and Internal/BuiltinEndpointSet to full.
") }, { LEAF("MeasureHbToAckLatency"), 1, "false", ABSOFF(meas_hb_to_ack_latency), 0, uf_boolean, 0, pf_boolean, BLURB("This element enables heartbeat-to-ack latency among DDSI2E services by prepending timestamps to Heartbeat and AckNack messages and calculating round trip times. This is non-standard behaviour. The measured latencies are quite noisy and are currently not used anywhere.
") }, - { LEAF("SuppressSPDPMulticast"), 1, "false", ABSOFF(suppress_spdp_multicast), 0, uf_boolean, 0, pf_boolean, - BLURB("The element controls whether the mandatory multicasting of the participant discovery packets occurs. Completely disabling multicasting requires this element be set to true, and generally requires explicitly listing peers to ping for unicast discovery.
\n\ -See also General/AllowMulticast.
") }, { LEAF("UnicastResponseToSPDPMessages"), 1, "true", ABSOFF(unicast_response_to_spdp_messages), 0, uf_boolean, 0, pf_boolean, BLURB("This element controls whether the response to a newly discovered participant is sent as a unicasted SPDP packet, instead of rescheduling the periodic multicasted one. There is no known benefit to setting this to false.
") }, { LEAF("SynchronousDeliveryPriorityThreshold"), 1, "0", ABSOFF(synchronous_delivery_priority_threshold), 0, uf_int, 0, pf_int, diff --git a/src/core/ddsi/src/q_ddsi_discovery.c b/src/core/ddsi/src/q_ddsi_discovery.c index a6e32cd..8a75416 100644 --- a/src/core/ddsi/src/q_ddsi_discovery.c +++ b/src/core/ddsi/src/q_ddsi_discovery.c @@ -160,7 +160,7 @@ static int get_locator (nn_locator_t *loc, const nn_locators_t *locs, int uc_sam static void maybe_add_pp_as_meta_to_as_disc (const struct addrset *as_meta) { - if (addrset_empty_mc (as_meta)) + if (addrset_empty_mc (as_meta) || !(config.allowMulticast & AMC_SPDP)) { nn_locator_t loc; if (addrset_any_uc (as_meta, &loc)) diff --git a/src/core/ddsi/src/q_init.c b/src/core/ddsi/src/q_init.c index add93b5..2c4601d 100644 --- a/src/core/ddsi/src/q_init.c +++ b/src/core/ddsi/src/q_init.c @@ -313,11 +313,6 @@ static int set_spdp_address (void) return -1; } #endif - if (!(config.allowMulticast & AMC_SPDP) || config.suppress_spdp_multicast) - { - /* Explicitly disabling SPDP multicasting is always possible */ - set_unspec_locator (&gv.loc_spdp_mc); - } return 0; } @@ -331,11 +326,6 @@ static int set_default_mc_address (void) return rc; else if (rc == 0) gv.loc_default_mc = gv.loc_spdp_mc; - if (!(config.allowMulticast & ~AMC_SPDP)) - { - /* no multicasting beyond SPDP */ - set_unspec_locator (&gv.loc_default_mc); - } gv.loc_meta_mc = gv.loc_default_mc; return 0; } @@ -791,7 +781,7 @@ static int setup_and_start_recv_threads (void) gv.recv_threads[0].arg.mode = RTM_MANY; if (gv.m_factory->m_connless && config.many_sockets_mode != MSM_NO_UNICAST && config.multiple_recv_threads) { - if (ddsi_is_mcaddr (&gv.loc_default_mc) && !ddsi_is_ssm_mcaddr (&gv.loc_default_mc)) + if (ddsi_is_mcaddr (&gv.loc_default_mc) && !ddsi_is_ssm_mcaddr (&gv.loc_default_mc) && (config.allowMulticast & AMC_ASM)) { /* Multicast enabled, but it isn't an SSM address => handle data multicasts on a separate thread (the trouble with SSM addresses is that we only join matching writers, which our own sockets typically would not be) */ gv.recv_threads[gv.n_recv_threads].name = "recvMC"; @@ -911,7 +901,6 @@ int rtps_init (void) config.publish_uc_locators = (config.tcp_port != -1); config.enable_uc_locators = 1; /* TCP affects what features are supported/required */ - config.suppress_spdp_multicast = 1; config.many_sockets_mode = MSM_SINGLE_UNICAST; config.allowMulticast = AMC_FALSE; if (ddsi_tcp_init () < 0) @@ -940,7 +929,6 @@ int rtps_init (void) if (!gv.interfaces[gv.selected_interface].mc_capable) { DDS_WARNING("selected interface is not multicast-capable: disabling multicast\n"); - config.suppress_spdp_multicast = 1; config.allowMulticast = AMC_FALSE; /* ensure discovery can work: firstly, that the process will be reachable on a "well-known" port number, and secondly, that the local interface's IP address gets added to the discovery @@ -1234,7 +1222,8 @@ int rtps_init (void) ); gv.as_disc = new_addrset (); - add_to_addrset (gv.as_disc, &gv.loc_spdp_mc); + if (config.allowMulticast & AMC_SPDP) + add_to_addrset (gv.as_disc, &gv.loc_spdp_mc); /* If multicast was enabled but not available, always add the local interface to the discovery address set. Conversion via string and add_peer_addresses has the benefit that the port number expansion happens automatically. */