[NET]: netfilter checksum annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -282,11 +282,27 @@ extern void nf_invalidate_cache(int pf);
|
||||
Returns true or false. */
|
||||
extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len);
|
||||
|
||||
extern u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval,
|
||||
u_int32_t csum);
|
||||
extern u_int16_t nf_proto_csum_update(struct sk_buff *skb,
|
||||
u_int32_t oldval, u_int32_t newval,
|
||||
u_int16_t csum, int pseudohdr);
|
||||
static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to)
|
||||
{
|
||||
__be32 diff[] = { ~from, to };
|
||||
|
||||
*sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum)));
|
||||
}
|
||||
|
||||
static inline void nf_csum_replace2(__sum16 *sum, __be16 from, __be16 to)
|
||||
{
|
||||
nf_csum_replace4(sum, (__force __be32)from, (__force __be32)to);
|
||||
}
|
||||
|
||||
extern void nf_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
|
||||
__be32 from, __be32 to, int pseudohdr);
|
||||
|
||||
static inline void nf_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
|
||||
__be16 from, __be16 to, int pseudohdr)
|
||||
{
|
||||
nf_proto_csum_replace4(sum, skb, (__force __be32)from,
|
||||
(__force __be32)to, pseudohdr);
|
||||
}
|
||||
|
||||
struct nf_afinfo {
|
||||
unsigned short family;
|
||||
|
Reference in New Issue
Block a user