From ebc643ffb0108f8f17e3e9bb8a5d1f7522c681b0 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 2 Feb 2023 15:18:25 +0100 Subject: [PATCH 1/5] pkg/nimble/autoadv: fix flag comparisons --- pkg/nimble/autoadv/nimble_autoadv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/nimble/autoadv/nimble_autoadv.c b/pkg/nimble/autoadv/nimble_autoadv.c index 32c1b14cd8..590f3fe778 100644 --- a/pkg/nimble/autoadv/nimble_autoadv.c +++ b/pkg/nimble/autoadv/nimble_autoadv.c @@ -192,11 +192,11 @@ void nimble_autoadv_start(ble_addr_t *addr) if (addr != NULL) { mode = BLE_GAP_CONN_MODE_DIR; } - else if (_cfg.flags && NIMBLE_AUTOADV_FLAG_CONNECTABLE) { + else if (_cfg.flags & NIMBLE_AUTOADV_FLAG_CONNECTABLE) { mode = BLE_GAP_CONN_MODE_UND; } - uint8_t disc = (_cfg.flags && NIMBLE_AUTOADV_FLAG_SCANNABLE) ? BLE_GAP_CONN_MODE_DIR - : BLE_GAP_CONN_MODE_UND; + uint8_t disc = (_cfg.flags & NIMBLE_AUTOADV_FLAG_SCANNABLE) ? BLE_GAP_CONN_MODE_DIR + : BLE_GAP_CONN_MODE_UND; struct ble_gap_adv_params advp = { .conn_mode = mode, .disc_mode = disc, From 47a610e7326b811bc0eff2e418b2414174642697 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 2 Feb 2023 15:41:59 +0100 Subject: [PATCH 2/5] sys/vfs: vfs.c: add missing `modules.h` include --- sys/vfs/vfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/vfs/vfs.c b/sys/vfs/vfs.c index 29881fc942..de7883d79b 100644 --- a/sys/vfs/vfs.c +++ b/sys/vfs/vfs.c @@ -23,6 +23,7 @@ #include /* for O_ACCMODE, ..., fcntl */ #include /* for STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO */ +#include "modules.h" #include "vfs.h" #include "mutex.h" #include "thread.h" From 177b50dfc2288d17e9982fb1cba0b83bb0e8d658 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 2 Feb 2023 15:50:09 +0100 Subject: [PATCH 3/5] sys/vfs: vfs.c: add missing "container.h" include --- sys/vfs/vfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/vfs/vfs.c b/sys/vfs/vfs.c index de7883d79b..c4eb4dbb0c 100644 --- a/sys/vfs/vfs.c +++ b/sys/vfs/vfs.c @@ -23,6 +23,7 @@ #include /* for O_ACCMODE, ..., fcntl */ #include /* for STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO */ +#include "container.h" #include "modules.h" #include "vfs.h" #include "mutex.h" From 1db6c4a9de62491dbdfc5ef6625b69c8c39957b0 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 2 Feb 2023 15:39:27 +0100 Subject: [PATCH 4/5] sys/net/crosslayer/inet_csum: add missing "modules.h" include --- sys/net/crosslayer/inet_csum/inet_csum.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/crosslayer/inet_csum/inet_csum.c b/sys/net/crosslayer/inet_csum/inet_csum.c index abeda848a8..bc07ab5468 100644 --- a/sys/net/crosslayer/inet_csum/inet_csum.c +++ b/sys/net/crosslayer/inet_csum/inet_csum.c @@ -14,6 +14,8 @@ #include #include + +#include "modules.h" #include "od.h" #include "net/inet_csum.h" From b7a5261508cdd61566e47598079e8040a5a09cab Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 2 Feb 2023 17:44:24 +0100 Subject: [PATCH 5/5] sys/net/grnc/netreg: avoid creating an infinite loop --- sys/net/gnrc/netreg/gnrc_netreg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/net/gnrc/netreg/gnrc_netreg.c b/sys/net/gnrc/netreg/gnrc_netreg.c index bf26713ac1..e56f0dda13 100644 --- a/sys/net/gnrc/netreg/gnrc_netreg.c +++ b/sys/net/gnrc/netreg/gnrc_netreg.c @@ -152,6 +152,13 @@ int gnrc_netreg_register(gnrc_nettype_t type, gnrc_netreg_entry_t *entry) } _gnrc_netreg_acquire_exclusive(); + + /* don't add the same entry twice */ + gnrc_netreg_entry_t *e; + LL_FOREACH(netreg[type], e) { + assert(entry != e); + } + LL_PREPEND(netreg[type], entry); _gnrc_netreg_release_exclusive();