From: Jan Engelhardt Date: Tue, 15 Jan 2008 07:32:54 +0000 (-0800) Subject: [NETFILTER]: xt_TOS: Properly set the TOS field X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cdfe8b9797f1a47fe24a9bf9e98a351bae11ab99;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [NETFILTER]: xt_TOS: Properly set the TOS field Fix incorrect mask value passed to ipv4_change_dsfield/ipv6_change_dsfield. Signed-off-by: Jan Engelhardt Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP.c index 9951e7f85e32..3d216d650c82 100644 --- a/net/netfilter/xt_DSCP.c +++ b/net/netfilter/xt_DSCP.c @@ -134,7 +134,7 @@ tos_tg(struct sk_buff *skb, const struct net_device *in, if (!skb_make_writable(skb, sizeof(struct iphdr))) return NF_DROP; iph = ip_hdr(skb); - ipv4_change_dsfield(iph, ~0, nv); + ipv4_change_dsfield(iph, 0, nv); } return XT_CONTINUE; @@ -156,7 +156,7 @@ tos_tg6(struct sk_buff *skb, const struct net_device *in, if (!skb_make_writable(skb, sizeof(struct iphdr))) return NF_DROP; iph = ipv6_hdr(skb); - ipv6_change_dsfield(iph, ~0, nv); + ipv6_change_dsfield(iph, 0, nv); } return XT_CONTINUE;