Re: [PATCH] [NETFILTER] xt_TCPMSS: combine nearly identical reverse_mtu4/6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 29 Mar 2008, Jan Engelhardt wrote:

> How about this one instead?

A minor correction is necessary, see below.

> commit 1143bd2cbcddb9fcdbffea6a2edfde42dca5bb46
> Author: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
> Date:   Sat Mar 29 16:20:13 2008 +0100
> 
>     [NETFILTER]: Collapse tcpmss_reverse_mtu{4,6} into one function
> 
>     Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
> ---
>  net/netfilter/xt_TCPMSS.c |   44 ++++++++++++++------------------------------
>  1 files changed, 14 insertions(+), 30 deletions(-)
> 
> diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
> index 217e2b6..2e3fe8e 100644
> --- a/net/netfilter/xt_TCPMSS.c
> +++ b/net/netfilter/xt_TCPMSS.c
> @@ -147,15 +147,19 @@ tcpmss_mangle_packet(struct sk_buff *skb,
>  	return TCPOLEN_MSS;
>  }
> 
> -static u_int32_t tcpmss_reverse_mtu4(const struct iphdr *iph)
> +static u_int32_t tcpmss_reverse_mtu(const struct sk_buff *skb,
> +                                    unsigned int family)
>  {
> -	struct flowi fl = {
> -		.fl4_dst = iph->saddr,
> -	};
> +	struct flowi fl = {};
>  	const struct nf_afinfo *ai;
>  	struct rtable *rt = NULL;
>  	u_int32_t mtu     = ~0U;
> 
> +	if (family == AF_INET)
> +		fl.fl4_dst = ip_hdr(skb)->saddr;
> +	else
> +		fl.fl6_dst = ipv6_hdr(skb)->saddr;
> +
>  	rcu_read_lock();
>  	ai = nf_get_afinfo(AF_INET);

s/AF_INET/family/



-- 
 i.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux