On Thu, Sep 27, 2007 at 05:10:08PM +0400, Evgeniy Polyakov wrote:
>
> +static inline void nf_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
> +                         __be32 from, __be32 to, int pseudohdr)
> +{
> +     __be32 diff[] = { ~from, to };
> +     if (skb->ip_summed != CHECKSUM_PARTIAL) {
> +             *sum = csum_fold(csum_partial(diff, sizeof(diff),
> +                             ~csum_unfold(*sum)));
> +             if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr)
> +                     skb->csum = ~csum_partial(diff, sizeof(diff),
> +                                             ~skb->csum);
> +     } else if (pseudohdr)
> +             *sum = ~csum_fold(csum_partial(diff, sizeof(diff),
> +                             csum_unfold(*sum)));
> +}

The embedded people are going to hate you for this :)

How about putting it in net/core/utils.c?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to