You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/12/08 13:50:05 UTC
[GitHub] [nuttx] gustavonihei commented on a diff in pull request #7826: net/ipfwd: limit number of ipforward struct to be less than number of IOB
gustavonihei commented on code in PR #7826:
URL: https://github.com/apache/nuttx/pull/7826#discussion_r1043374386
##########
net/ipforward/ipforward.h:
##########
@@ -42,6 +42,16 @@
# define CONFIG_NET_IPFORWARD_NSTRUCT 4
#endif
+#if CONFIG_IOB_NBUFFERS <= CONFIG_NET_IPFORWARD_NSTRUCT
+# error CONFIG_IOB_NBUFFERS <= CONFIG_NET_IPFORWARD_NSTRUCT \
+ IP forward may consume all the IOB and break netdev logic.
+#endif
Review Comment:
```suggestion
static_assert(CONFIG_IOB_NBUFFERS > CONFIG_NET_IPFORWARD_NSTRUCT,
"IP forward may consume all the IOB and break netdev logic");
```
nit: How about using a `static_assert` instead? It is defined in `assert.h` and seems cleaner.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org