[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46FBAD40.8040806@trash.net>
Date: Thu, 27 Sep 2007 15:16:48 +0200
From: Patrick McHardy <kaber@...sh.net>
To: Evgeniy Polyakov <johnpol@....mipt.ru>
CC: Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
jamal <hadi@...erus.ca>
Subject: Re: [PKT_SCHED]: Add stateless NAT
Evgeniy Polyakov wrote:
> +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);
> +}
> +
> +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)));
> +}
> +
> +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);
> +}
These are way too large to get inlined, please move somewhere below
net/core.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists