enable SSM support

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2018-06-13 15:52:43 +02:00
parent cf40d9df3f
commit e1a797f73c
2 changed files with 3 additions and 2 deletions

View file

@ -34,7 +34,7 @@ else()
add_library(ddsc "") add_library(ddsc "")
endif() endif()
add_definitions(-DDDSI_INCLUDE_NETWORK_PARTITIONS) add_definitions(-DDDSI_INCLUDE_NETWORK_PARTITIONS -DDDSI_INCLUDE_SSM)
include(ddsi/CMakeLists.txt) include(ddsi/CMakeLists.txt)
include(ddsc/CMakeLists.txt) include(ddsc/CMakeLists.txt)

View file

@ -287,6 +287,7 @@ static int set_spdp_address (void)
const uint32_t port = (uint32_t) (config.port_base + config.port_dg * config.domainId + config.port_d0); const uint32_t port = (uint32_t) (config.port_base + config.port_dg * config.domainId + config.port_d0);
int rc = 0; int rc = 0;
/* FIXME: FIXME: FIXME: */ /* FIXME: FIXME: FIXME: */
gv.loc_spdp_mc.kind = NN_LOCATOR_KIND_INVALID;
if (strcmp (config.spdpMulticastAddressString, "239.255.0.1") != 0) if (strcmp (config.spdpMulticastAddressString, "239.255.0.1") != 0)
{ {
if ((rc = string_to_default_locator (&gv.loc_spdp_mc, config.spdpMulticastAddressString, port, 1, "SPDP address")) < 0) if ((rc = string_to_default_locator (&gv.loc_spdp_mc, config.spdpMulticastAddressString, port, 1, "SPDP address")) < 0)
@ -304,7 +305,7 @@ static int set_spdp_address (void)
assert (rc > 0); assert (rc > 0);
} }
#ifdef DDSI_INCLUDE_SSM #ifdef DDSI_INCLUDE_SSM
if (ddsi_is_ssm_mcaddr (&gv.loc_spdp_mc)) if (gv.loc_spdp_mc.kind != NN_LOCATOR_KIND_INVALID && ddsi_is_ssm_mcaddr (&gv.loc_spdp_mc))
{ {
NN_ERROR ("%s: SPDP address may not be an SSM address\n", config.spdpMulticastAddressString); NN_ERROR ("%s: SPDP address may not be an SSM address\n", config.spdpMulticastAddressString);
return -1; return -1;