[arp] Validate length of ARP packet
authorMichael Brown <mcb30@ipxe.org>
Sat, 12 Mar 2016 01:21:18 +0000 (01:21 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sat, 12 Mar 2016 01:24:03 +0000 (01:24 +0000)
commit64acfd9ddd73bf38802f8c57e054d13a57b14198
tree97a1d42de582670763f60d8b21a840f4dfde6059
parent11396473f5878af70b0ec9714a03d81a0c05a771
[arp] Validate length of ARP packet

There is no practical way to generate an underlength ARP packet since
an ARP packet is always padded up to the minimum Ethernet frame length
(or dropped by the receiving Ethernet hardware if incorrectly padded),
but the absence of an explicit check causes warnings from some
analysis tools.

Fix by adding an explicit check on the I/O buffer length.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/if_arp.h
src/net/arp.c