From f133d5cca31dbe07ef5285046cd93429ce907285 Mon Sep 17 00:00:00 2001 From: Ryzee119 Date: Mon, 25 Nov 2024 12:39:33 +1030 Subject: [PATCH] lwip: Use modulo operator for mbox --- lib/net/nforceif/src/sys_arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/nforceif/src/sys_arch.c b/lib/net/nforceif/src/sys_arch.c index 953293b9f..a1d43499d 100644 --- a/lib/net/nforceif/src/sys_arch.c +++ b/lib/net/nforceif/src/sys_arch.c @@ -202,7 +202,7 @@ sys_mbox_post(struct sys_mbox **mb, void *msg) sys_arch_sem_wait(&mbox->write_sem, 0); sys_arch_sem_wait(&mbox->mutex, 0); - mbox->msgs[mbox->last & SYS_MBOX_SIZE] = msg; + mbox->msgs[mbox->last % SYS_MBOX_SIZE] = msg; mbox->last++; sys_sem_signal(&mbox->mutex);