Commit cdfe8b97 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by David S. Miller

[NETFILTER]: xt_TOS: Properly set the TOS field

Fix incorrect mask value passed to ipv4_change_dsfield/ipv6_change_dsfield.
Signed-off-by: default avatarJan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9bb268ed
...@@ -134,7 +134,7 @@ tos_tg(struct sk_buff *skb, const struct net_device *in, ...@@ -134,7 +134,7 @@ tos_tg(struct sk_buff *skb, const struct net_device *in,
if (!skb_make_writable(skb, sizeof(struct iphdr))) if (!skb_make_writable(skb, sizeof(struct iphdr)))
return NF_DROP; return NF_DROP;
iph = ip_hdr(skb); iph = ip_hdr(skb);
ipv4_change_dsfield(iph, ~0, nv); ipv4_change_dsfield(iph, 0, nv);
} }
return XT_CONTINUE; return XT_CONTINUE;
...@@ -156,7 +156,7 @@ tos_tg6(struct sk_buff *skb, const struct net_device *in, ...@@ -156,7 +156,7 @@ tos_tg6(struct sk_buff *skb, const struct net_device *in,
if (!skb_make_writable(skb, sizeof(struct iphdr))) if (!skb_make_writable(skb, sizeof(struct iphdr)))
return NF_DROP; return NF_DROP;
iph = ipv6_hdr(skb); iph = ipv6_hdr(skb);
ipv6_change_dsfield(iph, ~0, nv); ipv6_change_dsfield(iph, 0, nv);
} }
return XT_CONTINUE; return XT_CONTINUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment