From: Ido Schimmel <idosch@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>,
<edumazet@google.com>, <gnault@redhat.com>, <dsahern@kernel.org>,
<fw@strlen.de>, <martin.lau@linux.dev>, <daniel@iogearbox.net>,
<john.fastabend@gmail.com>, <ast@kernel.org>,
<pablo@netfilter.org>, <kadlec@netfilter.org>,
<willemdebruijn.kernel@gmail.com>, <bpf@vger.kernel.org>,
<netfilter-devel@vger.kernel.org>, <coreteam@netfilter.org>,
Ido Schimmel <idosch@nvidia.com>
Subject: [PATCH net-next 12/12] ipv4: Unmask upper DSCP bits when using hints
Date: Wed, 21 Aug 2024 15:52:51 +0300 [thread overview]
Message-ID: <20240821125251.1571445-13-idosch@nvidia.com> (raw)
In-Reply-To: <20240821125251.1571445-1-idosch@nvidia.com>
Unmask the upper DSCP bits when performing source validation and routing
a packet using the same route from a previously processed packet (hint).
In the future, this will allow us to perform the FIB lookup that is
performed as part of source validation 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 <idosch@nvidia.com>
---
net/ipv4/route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 524b70ab77a0..f6972b24664a 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2160,7 +2160,7 @@ int ip_route_use_hint(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (rt->rt_type != RTN_LOCAL)
goto skip_validate_source;
- tos &= IPTOS_RT_MASK;
+ tos &= INET_DSCP_MASK;
err = fib_validate_source(skb, saddr, daddr, tos, 0, dev, in_dev, &tag);
if (err < 0)
goto martian_source;
--
2.46.0
next prev parent reply other threads:[~2024-08-21 12:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 12:52 [PATCH net-next 00/12] Unmask upper DSCP bits - part 1 Ido Schimmel
2024-08-21 12:52 ` [PATCH net-next 01/12] bpf: Unmask upper DSCP bits in bpf_fib_lookup() helper Ido Schimmel
2024-08-21 14:35 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 02/12] ipv4: Unmask upper DSCP bits in NETLINK_FIB_LOOKUP family Ido Schimmel
2024-08-21 14:37 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 03/12] ipv4: Unmask upper DSCP bits when constructing the Record Route option Ido Schimmel
2024-08-21 14:46 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 04/12] netfilter: rpfilter: Unmask upper DSCP bits Ido Schimmel
2024-08-21 14:50 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 05/12] netfilter: nft_fib: " Ido Schimmel
2024-08-21 14:53 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 06/12] ipv4: ipmr: Unmask upper DSCP bits in ipmr_rt_fib_lookup() Ido Schimmel
2024-08-21 15:05 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 07/12] ipv4: Unmask upper DSCP bits in fib_compute_spec_dst() Ido Schimmel
2024-08-21 15:06 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 08/12] ipv4: Unmask upper DSCP bits in input route lookup Ido Schimmel
2024-08-21 16:28 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 09/12] ipv4: Unmask upper DSCP bits in RTM_GETROUTE " Ido Schimmel
2024-08-21 16:30 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 10/12] ipv4: icmp: Pass full DS field to ip_route_input() Ido Schimmel
2024-08-21 16:44 ` Guillaume Nault
2024-08-21 12:52 ` [PATCH net-next 11/12] ipv4: udp: Unmask upper DSCP bits during early demux Ido Schimmel
2024-08-21 16:46 ` Guillaume Nault
2024-08-21 12:52 ` Ido Schimmel [this message]
2024-08-21 16:50 ` [PATCH net-next 12/12] ipv4: Unmask upper DSCP bits when using hints Guillaume Nault
2024-08-21 14:48 ` [PATCH net-next 00/12] Unmask upper DSCP bits - part 1 Florian Westphal
2024-08-21 17:00 ` David Ahern
2024-08-23 0:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240821125251.1571445-13-idosch@nvidia.com \
--to=idosch@nvidia.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=coreteam@netfilter.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=gnault@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox