packet: set transport header before doing xmit
authorJason Wang <jasowang@redhat.com>
Mon, 25 Mar 2013 20:19:57 +0000 (20:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jun 2013 17:39:08 +0000 (10:39 -0700)
commiteb552c1b88aa59f3d9091c9c0351f727ff01f186
tree6b53c1a7da14bce6f1ed38033f22cab0cb1f3f34
parent6f23cbca260db299e3c2debcbfbd9c928bf79707
packet: set transport header before doing xmit

[ Upstream commit c1aad275b0293d2b1905ec95a945422262470684 ]

Set the transport header for 1) some drivers (e.g ixgbe needs l4 header to do
atr) 2) precise packet length estimation (introduced in 1def9238) needs l4
header to compute header length.

So this patch first tries to get l4 header for packet socket through
skb_flow_dissect(), and pretend no l4 header if skb_flow_dissect() fails.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/packet/af_packet.c