Only last IP frag sent if ARP entry absent
Gopakumar Pillai
gpillai at vmware.com
Thu Aug 17 21:17:06 UTC 2017
Hi FreeBSD Networking Gurus,
I came across an issue with an old version of FreeBSD and looking at the latest FreeBSD code, seems it exists even now. I am assuming that this issue is not reported.
Observation:
When a ping was performed with larger payload than MTU, the first ping failed when the ARP entry was absent for that IP.
Noticed on the wire that the last IP fragment was sent for the first request and then the subsequent requests were fine.
Root Cause:
* ip_output fragments the packets and loops through the fragments to send them to ether_output.
* ether_output does an arpresolve and if there is no existing ARP entry it'll return EWOULDBLOCK after sending ARP Request.
* ether_output ignores the error and propagates success to ip_output and it continues to send the remaining fragments.
* llentry keeps only one mbuf and the last fragment is retained when the ARP Reply comes and the fragment is sent.
Fix:
* Expose the EWOULDBLOCK error from ether_output to ip_output - but not beyond that.
* In ip_output while sending fragments if we get the EWOULDBLOCK error, populate the m_nextpkt pointer
so that the entire mbuf chain of fragments are kept around until the ARP reply comes.
* Modify in_arpinput function call (*ifp->if_output) in a loop until you exhaust the mbuf chain.
This fix is working. But wanted to know if there was a better way to fix this or not.
Once this fix is final, I can provide the patch to FreeBSD.
Thank You in advance.
--Gopu
More information about the freebsd-net
mailing list