Re: [PATCH] netfilter/IPv6: fix DSCP mangle code

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

 



From: Fernando Luis Vazquez Cao <fernando@xxxxxxxxxxxxx>
Date: Fri, 22 Apr 2011 16:02:39 +0900

> The mask indicates the bits one wants to zero out, so it needs to be
> inverted before applying to the original TOS field.
> 
> Signed-off-by: Fernando Luis Vazquez Cao <fernando@xxxxxxxxxxxxx>
> ---

Netfilter patches should be sent to the netfilter developer
list, CC:'d

> diff -urNp linux-2.6.37-orig/net/netfilter/xt_DSCP.c linux-2.6.37/net/netfilter/xt_DSCP.c
> --- linux-2.6.37-orig/net/netfilter/xt_DSCP.c	2011-01-05 09:50:19.000000000 +0900
> +++ linux-2.6.37/net/netfilter/xt_DSCP.c	2011-04-21 16:01:25.801890733 +0900
> @@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struc
>  	u_int8_t orig, nv;
>  
>  	orig = ipv6_get_dsfield(iph);
> -	nv   = (orig & info->tos_mask) ^ info->tos_value;
> +	nv   = (orig & ~info->tos_mask) ^ info->tos_value;
>  
>  	if (orig != nv) {
>  		if (!skb_make_writable(skb, sizeof(struct iphdr)))
> 
> 
--
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