]> err.no Git - linux-2.6/commitdiff
[NETFILTER]: xt_TOS: Properly set the TOS field
authorJan Engelhardt <jengelh@computergmbh.de>
Tue, 15 Jan 2008 07:32:54 +0000 (23:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:02:18 +0000 (15:02 -0800)
Fix incorrect mask value passed to ipv4_change_dsfield/ipv6_change_dsfield.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/xt_DSCP.c

index 9951e7f85e32ecd4b43117e516c8d62dd6bc3755..3d216d650c82d3612141d48461710de902f3d486 100644 (file)
@@ -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;