net/ethernet: ARP can be configured on interface #3271
+149
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Nuttx use IFF_NOARP as a packet config, this is illogical and no longer in line with user habits.
Referring to the ARP configuration method of Linux, Nuttx has added the ability to configure ARP on interface.
Impact
Referring to the custom of configuring ARP on Linux interfaces, the 'arp/- app' parameter has been added to the ifconfig command.
When the ARP function of an interface is turned off, the net stack will discard ARP messages received from that interface, and the protocol stack will not send messages to the outside through that interface.
Testing
When compiling nuttx, open the ping tool for functional testing.
Set up a SIM environment, sim and host can ping each other successfully.
After using the command 'ifconfig eth0 -arp', the ping between sim and host failed. The packet capture shows that sim cannot process APR request messages or send ARP request messages.
Then use 'ifconfig eth0 arp' to enable arp fuction for eth0, sim and host can ping each other again.