Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / include / net / udp.h
index e82f3a8..67ea6fc 100644 (file)
@@ -144,6 +144,17 @@ static inline __wsum udp_csum_outgoing(struct sock *sk, struct sk_buff *skb)
        return csum;
 }
 
+static inline __wsum udp_csum(struct sk_buff *skb)
+{
+       __wsum csum = csum_partial(skb_transport_header(skb),
+                                  sizeof(struct udphdr), skb->csum);
+
+       for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next) {
+               csum = csum_add(csum, skb->csum);
+       }
+       return csum;
+}
+
 /* hash routines shared between UDPv4/6 and UDP-Litev4/6 */
 static inline void udp_lib_hash(struct sock *sk)
 {