Skip to content

Commit 4f08807

Browse files
idoschdavem330
authored andcommitted
ipv4: netfilter: Unmask upper DSCP bits in ip_route_me_harder()
Unmask the upper DSCP bits when calling ip_route_output_key() so that in the future it could perform the FIB lookup according to the full DSCP value. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c2b639f commit 4f08807

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/netfilter.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <net/route.h>
1515
#include <net/xfrm.h>
1616
#include <net/ip.h>
17+
#include <net/inet_dscp.h>
1718
#include <net/netfilter/nf_queue.h>
1819

1920
/* route_me_harder function, used by iptable_nat, iptable_mangle + ip_queue */
@@ -43,7 +44,7 @@ int ip_route_me_harder(struct net *net, struct sock *sk, struct sk_buff *skb, un
4344
*/
4445
fl4.daddr = iph->daddr;
4546
fl4.saddr = saddr;
46-
fl4.flowi4_tos = RT_TOS(iph->tos);
47+
fl4.flowi4_tos = iph->tos & INET_DSCP_MASK;
4748
fl4.flowi4_oif = sk ? sk->sk_bound_dev_if : 0;
4849
fl4.flowi4_l3mdev = l3mdev_master_ifindex(dev);
4950
fl4.flowi4_mark = skb->mark;

0 commit comments

Comments
 (0)