Skip to content

Commit b717276

Browse files
idoschdavem330
authored andcommitted
netfilter: nft_flow_offload: Unmask upper DSCP bits in nft_flow_route()
Unmask the upper DSCP bits when calling nf_route() which eventually calls 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 4f08807 commit b717276

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nft_flow_offload.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/netfilter/nf_conntrack_common.h>
1010
#include <linux/netfilter/nf_tables.h>
1111
#include <net/ip.h> /* for ipv4 options. */
12+
#include <net/inet_dscp.h>
1213
#include <net/netfilter/nf_tables.h>
1314
#include <net/netfilter/nf_tables_core.h>
1415
#include <net/netfilter/nf_conntrack_core.h>
@@ -235,7 +236,7 @@ static int nft_flow_route(const struct nft_pktinfo *pkt,
235236
fl.u.ip4.saddr = ct->tuplehash[!dir].tuple.src.u3.ip;
236237
fl.u.ip4.flowi4_oif = nft_in(pkt)->ifindex;
237238
fl.u.ip4.flowi4_iif = this_dst->dev->ifindex;
238-
fl.u.ip4.flowi4_tos = RT_TOS(ip_hdr(pkt->skb)->tos);
239+
fl.u.ip4.flowi4_tos = ip_hdr(pkt->skb)->tos & INET_DSCP_MASK;
239240
fl.u.ip4.flowi4_mark = pkt->skb->mark;
240241
fl.u.ip4.flowi4_flags = FLOWI_FLAG_ANYSRC;
241242
break;

0 commit comments

Comments
 (0)