mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 17:53:56 +08:00
packet: do skb_probe_transport_header when we actually have data
In tpacket_fill_skb() commitc1aad275b0
("packet: set transport header before doing xmit") and later on40893fd0fd
("net: switch to use skb_probe_transport_header()") was probing for a transport header on the skb from a ring buffer slot, but at a time, where the skb has _not even_ been filled with data yet. So that call into the flow dissector is pretty useless. Lets do it after we've set up the skb frags. Fixes:c1aad275b0
("packet: set transport header before doing xmit") Reported-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d7475de585
commit
efdfa2f784
@ -2368,8 +2368,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
|
||||
skb_reserve(skb, hlen);
|
||||
skb_reset_network_header(skb);
|
||||
|
||||
if (!packet_use_direct_xmit(po))
|
||||
skb_probe_transport_header(skb, 0);
|
||||
if (unlikely(po->tp_tx_has_off)) {
|
||||
int off_min, off_max, off;
|
||||
off_min = po->tp_hdrlen - sizeof(struct sockaddr_ll);
|
||||
@ -2449,6 +2447,9 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
|
||||
len = ((to_write > len_max) ? len_max : to_write);
|
||||
}
|
||||
|
||||
if (!packet_use_direct_xmit(po))
|
||||
skb_probe_transport_header(skb, 0);
|
||||
|
||||
return tp_len;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user