Commit 884d338c041c2aa4536ade8620efa585e7c57f3c

Authored by Tom Herbert
Committed by David S. Miller
1 parent 2abb7cdc0d

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: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 10 additions and 2 deletions Side-by-side Diff

net/ipv4/gre_demux.c
... ... @@ -125,6 +125,10 @@
125 125 *csum_err = true;
126 126 return -EINVAL;
127 127 }
  128 +
  129 + skb_checksum_try_convert(skb, IPPROTO_GRE, 0,
  130 + null_compute_pseudo);
  131 +
128 132 options++;
129 133 }
130 134  
net/ipv4/gre_offload.c
... ... @@ -172,9 +172,13 @@
172 172 }
173 173  
174 174 /* Don't bother verifying checksum if we're going to flush anyway. */
175   - if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush &&
176   - skb_gro_checksum_simple_validate(skb))
  175 + if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush) {
  176 + if (skb_gro_checksum_simple_validate(skb))
177 177 goto out_unlock;
  178 +
  179 + skb_gro_checksum_try_convert(skb, IPPROTO_GRE, 0,
  180 + null_compute_pseudo);
  181 + }
178 182  
179 183 flush = 0;
180 184