提交 884d338c 编写于 作者: T Tom Herbert 提交者: David S. Miller

gre: Add support for checksum unnecessary conversions

Call skb_checksum_try_convert and skb_gro_checksum_try_convert
after checksum is found present and validated in the GRE header
for normal and GRO paths respectively.

In GRO path, call skb_gro_checksum_try_convert
Signed-off-by: NTom Herbert <therbert@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2abb7cdc
...@@ -125,6 +125,10 @@ static int parse_gre_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, ...@@ -125,6 +125,10 @@ static int parse_gre_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
*csum_err = true; *csum_err = true;
return -EINVAL; return -EINVAL;
} }
skb_checksum_try_convert(skb, IPPROTO_GRE, 0,
null_compute_pseudo);
options++; options++;
} }
......
...@@ -172,10 +172,14 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head, ...@@ -172,10 +172,14 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head,
} }
/* Don't bother verifying checksum if we're going to flush anyway. */ /* Don't bother verifying checksum if we're going to flush anyway. */
if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush && if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush) {
skb_gro_checksum_simple_validate(skb)) if (skb_gro_checksum_simple_validate(skb))
goto out_unlock; goto out_unlock;
skb_gro_checksum_try_convert(skb, IPPROTO_GRE, 0,
null_compute_pseudo);
}
flush = 0; flush = 0;
for (p = *head; p; p = p->next) { for (p = *head; p; p = p->next) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册