[nrf fromlist] mgmt: mcumgr: callbacks: Fix not checking event ID properly
Fixes an issue whereby event ID was not checked properly, meaning
that OR'd events would not work as one would expect.
Upstream PR:
@@ -104,9 +104,12 @@ int32_t mgmt_callback_notify(uint32_t event, void *data, size_t data_size)
struct mgmt_callback *loop_group =
CONTAINER_OF(snp, struct mgmt_callback, node);
- if (loop_group->event_id == event || loop_group->event_id == MGMT_EVT_OP_ALL ||
+ if (loop_group->event_id == MGMT_EVT_OP_ALL ||
(MGMT_EVT_GET_GROUP(loop_group->event_id) == group &&
- MGMT_EVT_GET_ID(loop_group->event_id) == MGMT_EVT_OP_ID_ALL)) {
+ (MGMT_EVT_GET_ID(loop_group->event_id) == MGMT_EVT_OP_ID_ALL ||
+ (MGMT_EVT_GET_ID(event) & MGMT_EVT_GET_ID(loop_group->event_id)) ==
+ MGMT_EVT_GET_ID(event)))) {
+
rc = loop_group->callback(event, return_rc, &abort_more, data, data_size);
if (rc != MGMT_ERR_EOK && failed == false) {
