Skip to content

Commit

Permalink
[NETFILTER]: xt_TOS: Properly set the TOS field
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Engelhardt authored and David S. Miller committed Jan 28, 2008
1 parent 9bb268e commit cdfe8b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/netfilter/xt_DSCP.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit cdfe8b9

Please sign in to comment.