udp: Switch to ip_finish_skb

This patch converts UDP to use the new ip_finish_skb API.  This
would then allows us to more easily use ip_make_skb which allows
UDP to run without a socket lock.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Herbert Xu
2011-03-01 02:36:48 +00:00
committed by David S. Miller
parent 1c32c5ad6f
commit f6b9664f8b
3 changed files with 99 additions and 59 deletions

View File

@@ -115,6 +115,18 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
return csum;
}
static inline __wsum udplite_csum(struct sk_buff *skb)
{
struct sock *sk = skb->sk;
int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
const int off = skb_transport_offset(skb);
const int len = skb->len - off;
skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
return skb_checksum(skb, off, min(cscov, len), 0);
}
extern void udplite4_register(void);
extern int udplite_get_port(struct sock *sk, unsigned short snum,
int (*scmp)(const struct sock *, const struct sock *));