From 40893fd0fd4e0eda8c6a53db6a8e6013b2d44c16 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Tue, 26 Mar 2013 23:11:22 +0000 Subject: 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 Signed-off-by: Jason Wang Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- drivers/net/macvtap.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'drivers/net/macvtap.c') diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index acf6450ceff5..59e9605de316 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -21,7 +21,6 @@ #include #include #include -#include /* * A macvtap queue is the central object of this driver, it connects @@ -646,7 +645,6 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, int vnet_hdr_len = 0; int copylen = 0; bool zerocopy = false; - struct flow_keys keys; if (q->flags & IFF_VNET_HDR) { vnet_hdr_len = q->vnet_hdr_sz; @@ -727,12 +725,7 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q, struct msghdr *m, goto err_kfree; } - if (skb->ip_summed == CHECKSUM_PARTIAL) - skb_set_transport_header(skb, skb_checksum_start_offset(skb)); - else if (skb_flow_dissect(skb, &keys)) - skb_set_transport_header(skb, keys.thoff); - else - skb_set_transport_header(skb, ETH_HLEN); + skb_probe_transport_header(skb, ETH_HLEN); rcu_read_lock_bh(); vlan = rcu_dereference_bh(q->vlan); -- cgit v1.2.3