Skip to content

Commit 338385e

Browse files
idoschkuba-moo
authored andcommitted
netfilter: nft_fib: Unmask upper DSCP bits
In a similar fashion to the iptables rpfilter match, unmask the upper DSCP bits of the DS field of the currently tested packet so that in the future the FIB lookup could be performed according to the full DSCP value. No functional changes intended since the upper DSCP bits are masked when comparing against the TOS selectors in FIB rules and routes. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Guillaume Nault <[email protected]> Acked-by: Florian Westphal <[email protected]> Reviewed-by: David Ahern <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c1ae5ca commit 338385e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/netfilter/nft_fib_ipv4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <net/netfilter/nf_tables.h>
1111
#include <net/netfilter/nft_fib.h>
1212

13+
#include <net/inet_dscp.h>
1314
#include <net/ip_fib.h>
1415
#include <net/route.h>
1516

@@ -108,7 +109,7 @@ void nft_fib4_eval(const struct nft_expr *expr, struct nft_regs *regs,
108109
if (priv->flags & NFTA_FIB_F_MARK)
109110
fl4.flowi4_mark = pkt->skb->mark;
110111

111-
fl4.flowi4_tos = iph->tos & IPTOS_RT_MASK;
112+
fl4.flowi4_tos = iph->tos & INET_DSCP_MASK;
112113

113114
if (priv->flags & NFTA_FIB_F_DADDR) {
114115
fl4.daddr = iph->daddr;

0 commit comments

Comments
 (0)