zhhyu7 opened a new pull request, #21978: URL: https://github.com/apache/nuttx/pull/21978
## Summary * When the outgoing device sends slower than packets arrive, forward callbacks pile up on its callback list and can exhaust the callback pool shared by the whole stack. * Add CONFIG_NET_FORWARD_NCALLBACKS, the maximum number of IPFWD_POLL callbacks cached on one outgoing device. netfwd_forward_notify() counts them with the new devif_count_callbacks() and returns -ENOMEM at the limit. The caller then frees fwd and the packet is dropped. * The default is 0, which means no limit and keeps the current behavior. * The count is taken with the outgoing device's lock held, so it depends on PR 1. ## Impact * New feature: YES. One Kconfig option, and an internal helper devif_count_callbacks() in net/devif/devif.h (not a public API). * Impact on user: NO. The default does not change behavior. With a non-zero limit, packets over the limit are dropped. * Impact on build: new option under NET_FORWARD, default 0. No in-tree defconfig sets it, so refresh.sh has nothing to update. * Impact on hardware: NO. * Impact on documentation: NO. * Impact on security: bounds resource use under heavy forwarding. * Impact on compatibility: NO at the default. * Anything else: the limit is per outgoing device, not global. ## Testing I will add the test log later. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
