Skip to content

Commit 32725c0

Browse files
committed
Make multicast trusting configurable in CmakeLists
1 parent 48b8db1 commit 32725c0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ set(CLANG_TIDY_ENABLED OFF CACHE BOOL "Enable clang-tidy analysis during compila
3131
set(OC_USE_STORAGE ON CACHE BOOL "Persistent storage of data.")
3232
set(OC_USE_MULTICAST_SCOPE_2 ON CACHE BOOL "devices send also group multicast events with scope2.")
3333
set(OC_REPLAY_PROTECTION_ENABLED ON CACHE BOOL "Enable replay protection using the Echo option")
34+
set(OC_TRUST_FIRST_MCAST ON CACHE BOOL "Trust first multicast message from an unsynchronised client")
3435

3536
set(KNX_BUILTIN_MBEDTLS ON CACHE BOOL "Use built-in mbedTLS, as opposed to external lib from different project")
3637
set(KNX_BUILTIN_TINYCBOR ON CACHE BOOL "Use built-in TinyCBOR, as opposed to external lib from different project")

api/oc_replay.c

+4
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,16 @@ oc_replay_check_client(uint64_t rx_ssn, oc_string_t rx_kid,
159159

160160
struct oc_replay_record *rec = get_record(rx_kid, rx_kid_ctx);
161161
if (rec == NULL) {
162+
#if OC_TRUST_FIRST_MCAST
162163
if (is_mcast) {
163164
oc_replay_add_client(rx_ssn, rx_kid, rx_kid_ctx);
164165
return true;
165166
} else {
166167
return false;
167168
}
169+
#else
170+
return false;
171+
#endif
168172
}
169173
// received message matched existing record, so this record is useful &
170174
// should be kept around - thus we update the time here

0 commit comments

Comments
 (0)