summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-04-27 16:44:45 +0400
committerDavid S. Miller <davem@davemloft.net>2009-04-27 16:44:45 +0400
commit36e7b1b8dac1a785abca3a121b6b0b79f1a8d7df (patch)
treecdde7191a6e5d78bf9603983d5a71ec99fd5385b /include
parentedbd9e30306067c3a45c035eb95a6f49daaa2337 (diff)
downloadlinux-36e7b1b8dac1a785abca3a121b6b0b79f1a8d7df.tar.xz
gro: Fix COMPLETE checksum handling
On a brand new GRO skb, we cannot call ip_hdr since the header may lie in the non-linear area. This patch adds the helper skb_gro_network_header to handle this. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c9ef41916071..fe20d171acf1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1142,6 +1142,13 @@ static inline void *skb_gro_mac_header(struct sk_buff *skb)
skb_shinfo(skb)->frags[0].page_offset;
}
+static inline void *skb_gro_network_header(struct sk_buff *skb)
+{
+ return skb_headlen(skb) ? skb_network_header(skb) :
+ page_address(skb_shinfo(skb)->frags[0].page) +
+ skb_shinfo(skb)->frags[0].page_offset + skb_network_offset(skb);
+}
+
static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type,
const void *daddr, const void *saddr,