diff options
author | Jason Wang <jasowang@redhat.com> | 2013-03-26 19:11:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-27 12:48:31 -0400 |
commit | 40893fd0fd4e0eda8c6a53db6a8e6013b2d44c16 (patch) | |
tree | f61f8374d9a77385ef06012256b68633edb27e2c /drivers/net/xen-netback | |
parent | 5203cd28db6dc05c3618a602cf4cf81203d00257 (diff) |
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>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r-- | drivers/net/xen-netback/netback.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index fc8faa74b250..83905a97c56c 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/udp.h> | 39 | #include <linux/udp.h> |
40 | 40 | ||
41 | #include <net/tcp.h> | 41 | #include <net/tcp.h> |
42 | #include <net/flow_keys.h> | ||
43 | 42 | ||
44 | #include <xen/xen.h> | 43 | #include <xen/xen.h> |
45 | #include <xen/events.h> | 44 | #include <xen/events.h> |
@@ -1506,14 +1505,7 @@ static void xen_netbk_tx_submit(struct xen_netbk *netbk) | |||
1506 | continue; | 1505 | continue; |
1507 | } | 1506 | } |
1508 | 1507 | ||
1509 | if (!skb_transport_header_was_set(skb)) { | 1508 | skb_probe_transport_header(skb, 0); |
1510 | struct flow_keys keys; | ||
1511 | |||
1512 | if (skb_flow_dissect(skb, &keys)) | ||
1513 | skb_set_transport_header(skb, keys.thoff); | ||
1514 | else | ||
1515 | skb_reset_transport_header(skb); | ||
1516 | } | ||
1517 | 1509 | ||
1518 | vif->dev->stats.rx_bytes += skb->len; | 1510 | vif->dev->stats.rx_bytes += skb->len; |
1519 | vif->dev->stats.rx_packets++; | 1511 | vif->dev->stats.rx_packets++; |