diff options
Diffstat (limited to 'include/net/udplite.h')
-rw-r--r-- | include/net/udplite.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/udplite.h b/include/net/udplite.h index afdffe607b24..673a024c6b2a 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h | |||
@@ -115,6 +115,18 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb) | |||
115 | return csum; | 115 | return csum; |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline __wsum udplite_csum(struct sk_buff *skb) | ||
119 | { | ||
120 | struct sock *sk = skb->sk; | ||
121 | int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb)); | ||
122 | const int off = skb_transport_offset(skb); | ||
123 | const int len = skb->len - off; | ||
124 | |||
125 | skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ | ||
126 | |||
127 | return skb_checksum(skb, off, min(cscov, len), 0); | ||
128 | } | ||
129 | |||
118 | extern void udplite4_register(void); | 130 | extern void udplite4_register(void); |
119 | extern int udplite_get_port(struct sock *sk, unsigned short snum, | 131 | extern int udplite_get_port(struct sock *sk, unsigned short snum, |
120 | int (*scmp)(const struct sock *, const struct sock *)); | 132 | int (*scmp)(const struct sock *, const struct sock *)); |