
The issue [1] was reported by (Peter) Tran Tien Dat. Unfortunately his fix for the issue broke notmal operation and I don't feel is a good way to address the issue. Also, the situation was not covered in the unit tests, so we'll add them now.
First we refactor the unit test capability of the sandbox ethernet fake driver so that we can exercise that part of the network stack, then add the tests where we prove that the async replies work, but that in the process, the action expected by the user (ping in this case) is broken.
Lastly, we correct the problem and change the unit tests to also expect success of the user's operation.
[1] https://patchwork.ozlabs.org/patch/939617/
Joe Hershberger (10): net: sandbox: Move disabled flag into priv struct net: sandbox: Refactor sandbox send function net: sandbox: Make the fake eth driver response configurable net: sandbox: Share the priv structure with tests net: sandbox: Allow fake eth to handle more than 1 packet response net: Add an accessor to know if waiting for ARP net: sandbox: Add a priv ptr for tests to use test: eth: Add a test for ARP requests test: eth: Add a test for the target being pinged net: Don't overwrite waiting packets with asynchronous replies
arch/sandbox/include/asm/eth.h | 85 +++++++++ drivers/net/sandbox.c | 415 +++++++++++++++++++++++++++++++---------- include/net.h | 9 + net/arp.c | 20 +- net/arp.h | 1 + net/net.c | 8 + net/ping.c | 7 +- test/dm/eth.c | 160 ++++++++++++++++ 8 files changed, 596 insertions(+), 109 deletions(-)