net: switch to use skb_probe_transport_header()

Switch to use the new help skb_probe_transport_header() to do the l4 header
probing for untrusted sources. For packets with partial csum, the header should
already been set by skb_partial_csum_set().

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jason Wang
2013-03-26 23:11:22 +00:00
committed by David S. Miller
parent 5203cd28db
commit 40893fd0fd
4 changed files with 6 additions and 45 deletions

View File

@@ -39,7 +39,6 @@
#include <linux/udp.h>
#include <net/tcp.h>
#include <net/flow_keys.h>
#include <xen/xen.h>
#include <xen/events.h>
@@ -1506,14 +1505,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk)
continue;
}
if (!skb_transport_header_was_set(skb)) {
struct flow_keys keys;
if (skb_flow_dissect(skb, &keys))
skb_set_transport_header(skb, keys.thoff);
else
skb_reset_transport_header(skb);
}
skb_probe_transport_header(skb, 0);
vif->dev->stats.rx_bytes += skb->len;
vif->dev->stats.rx_packets++;