net/devif: Reorder ipv4_input packet classification.#18764
net/devif: Reorder ipv4_input packet classification.#18764ankohuu wants to merge 1 commit intoapache:masterfrom
Conversation
b027ba1 to
cf4e86d
Compare
|
@ankohuu I think it is important to do more real world tests before merging it. Unfortunately we don't have good network testing tools. The nettest seems very simple for more complex test. And in fact a real test will require a board and a computer or some application running in the host computer and a test set in the NuttX SIMulator. |
Thanks acassis. I will try to run more tests and update the PR with the results. Please hold off on merging until then; comments are welcome in the meantime. I will
|
|
@anchao could you take a look at this and share feedback? thanks |
cf4e86d to
772f1ef
Compare
Rework ipv4_input() packet classification to make the control flow clearer and keep the common local-unicast case first. This change: - handles local packets first - keeps broadcast/multicast handling in dedicated branches It also prevents broadcast and multicast packets from falling through into the unicast forward path. Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
772f1ef to
e4550bf
Compare
Summary
After reading the ipv4_input code, I think the behavior is not so clearly, and in some cases it appears incorrect.
For example, when
NET_UDPis not enabled + broadcast packets, as well as multicast packets that do not matchany IGMP group, both fall into the ip_forward path. here
So I rework ipv4_input() packet classification to make the control flow clearer and keep the common local-unicast
case first.
This change:
Impact
Refactored the IPv4 input forwarding logic using an equivalent formulation.
Testing
Nuttx SIMulator
ESP32 only one nic