packet: make packet_snd fail on len smaller than l2 header
authorWillem de Bruijn <willemb@google.com>
Wed, 19 Nov 2014 18:10:16 +0000 (13:10 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Nov 2014 19:43:07 +0000 (14:43 -0500)
commit9c7077622dd917457ced680a23b7f175769471d9
tree8c162e5ef188298d9fce81c7d2a6fb216f2d0a5c
parentdf6ce47091620d76bbe036d0af3dc1abad4576c1
packet: make packet_snd fail on len smaller than l2 header

When sending packets out with PF_PACKET, SOCK_RAW, ensure that the
packet is at least as long as the device's expected link layer header.
This check already exists in tpacket_snd, but not in packet_snd.
Also rate limit the warning in tpacket_snd.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c