Skip to content

Commit 345663e

Browse files
idoschdavem330
authored andcommitted
netfilter: nf_dup4: Unmask upper DSCP bits in nf_dup_ipv4_route()
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 b717276 commit 345663e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/netfilter/nf_dup_ipv4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <net/icmp.h>
1616
#include <net/ip.h>
1717
#include <net/route.h>
18+
#include <net/inet_dscp.h>
1819
#include <net/netfilter/ipv4/nf_dup_ipv4.h>
1920
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
2021
#include <net/netfilter/nf_conntrack.h>
@@ -32,7 +33,7 @@ static bool nf_dup_ipv4_route(struct net *net, struct sk_buff *skb,
3233
fl4.flowi4_oif = oif;
3334

3435
fl4.daddr = gw->s_addr;
35-
fl4.flowi4_tos = RT_TOS(iph->tos);
36+
fl4.flowi4_tos = iph->tos & INET_DSCP_MASK;
3637
fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
3738
fl4.flowi4_flags = FLOWI_FLAG_KNOWN_NH;
3839
rt = ip_route_output_key(net, &fl4);

0 commit comments

Comments
 (0)