aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/ip6_checksum.h
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-08-22 13:34:04 -0700
committerDavid S. Miller <davem@davemloft.net>2014-08-24 18:09:23 -0700
commit1933a7852ce6a81349855431b25122d7666bbfca (patch)
treeeae9d27a1800e7b3317aa4441457615858b783f9 /include/net/ip6_checksum.h
parentnet: skb_gro_checksum_* functions (diff)
downloadwireguard-linux-1933a7852ce6a81349855431b25122d7666bbfca.tar.xz
wireguard-linux-1933a7852ce6a81349855431b25122d7666bbfca.zip
net: add gro_compute_pseudo functions
Add inet_gro_compute_pseudo and ip6_gro_compute_pseudo. These are the logical equivalents of inet_compute_pseudo and ip6_compute_pseudo for GRO path. The IP header is taken from skb_gro_network_header. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_checksum.h')
-rw-r--r--include/net/ip6_checksum.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index 55236cb71174..1a49b73f7f6e 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -48,6 +48,14 @@ static inline __wsum ip6_compute_pseudo(struct sk_buff *skb, int proto)
skb->len, proto, 0));
}
+static inline __wsum ip6_gro_compute_pseudo(struct sk_buff *skb, int proto)
+{
+ const struct ipv6hdr *iph = skb_gro_network_header(skb);
+
+ return ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr,
+ skb_gro_len(skb), proto, 0));
+}
+
static __inline__ __sum16 tcp_v6_check(int len,
const struct in6_addr *saddr,
const struct in6_addr *daddr,