From f8d004b92fe4c96fd48185aa7a2519832ca04065 Mon Sep 17 00:00:00 2001 From: Olav Frengstad Date: Wed, 6 Jun 2018 16:53:16 +0200 Subject: [PATCH] Move LLSEC checks from `tsch-security.h` to `tsch-security.c` Different part of the stack is pulled in from `contiki-main.c` this has the unintended side effect of including TSCH headers even when TSCH is not used. When using LLSEC for CSMA this triggers an error and compilation fails. --- os/net/mac/tsch/tsch-security.c | 4 ++++ os/net/mac/tsch/tsch-security.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/os/net/mac/tsch/tsch-security.c b/os/net/mac/tsch/tsch-security.c index 1c4266626..12f0de6d5 100644 --- a/os/net/mac/tsch/tsch-security.c +++ b/os/net/mac/tsch/tsch-security.c @@ -53,6 +53,10 @@ #include #include +#if LLSEC802154_ENABLED && !LLSEC802154_USES_EXPLICIT_KEYS +#error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset +#endif /* LLSEC802154_ENABLED */ + /* The two keys K1 and K2 from 6TiSCH minimal configuration * K1: well-known, used for EBs * K2: secret, used for data and ACK diff --git a/os/net/mac/tsch/tsch-security.h b/os/net/mac/tsch/tsch-security.h index 56c854414..4320d3a70 100644 --- a/os/net/mac/tsch/tsch-security.h +++ b/os/net/mac/tsch/tsch-security.h @@ -54,10 +54,6 @@ * - set LLSEC802154_CONF_USES_EXPLICIT_KEYS * */ -#if LLSEC802154_ENABLED && !LLSEC802154_USES_EXPLICIT_KEYS -#error LLSEC802154_ENABLED set but LLSEC802154_USES_EXPLICIT_KEYS unset -#endif /* LLSEC802154_ENABLED */ - /* K1, defined in 6TiSCH minimal, is well-known (offers no security) and used for EBs only */ #ifdef TSCH_SECURITY_CONF_K1 #define TSCH_SECURITY_K1 TSCH_SECURITY_CONF_K1