packet: parse tpacket header before skb alloc
authorWillem de Bruijn <willemb@google.com>
Wed, 3 Feb 2016 23:02:16 +0000 (18:02 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Feb 2016 11:43:50 +0000 (06:43 -0500)
commit8d39b4a6b83c141acaf0b5e8f90fd5e67721ff90
treea4ba273deffe97e83056747c0d0840805e04a4a4
parent58d19b19cd99b438541eea4cdbf5c171900b25e5
packet: parse tpacket header before skb alloc

GSO packet headers must be stored in the linear skb segment.
Move tpacket header parsing before sock_alloc_send_skb. The GSO
follow-on patch will later increase the skb linear argument to
sock_alloc_send_skb if needed for large packets.

The header parsing code does not require an allocated skb, so is
safe to move. Later pass to tpacket_fill_skb the computed data
start and length.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c