]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipvlan: Unmask upper DSCP bits in ipvlan_process_v4_outbound()
authorIdo Schimmel <idosch@nvidia.com>
Thu, 29 Aug 2024 06:54:57 +0000 (09:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2025 15:56:44 +0000 (16:56 +0100)
[ Upstream commit 939cd1abf080c629552a9c5e6db4c0509d13e4c7 ]

Unmask the upper DSCP bits when calling ip_route_output_flow() so that
in the future it could perform the FIB lookup according to the full DSCP
value.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 27843ce6ba3d ("ipvlan: ensure network headers are in skb linear part")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ipvlan/ipvlan_core.c

index 1d49771d07f4c2f6122750d4da4f9d7cf1ec6b87..d22a705ac4d6f2d4e8b07dfe52ddfd90200e2f08 100644 (file)
@@ -2,6 +2,8 @@
 /* Copyright (c) 2014 Mahesh Bandewar <maheshb@google.com>
  */
 
+#include <net/inet_dscp.h>
+
 #include "ipvlan.h"
 
 static u32 ipvlan_jhash_secret __read_mostly;
@@ -420,7 +422,7 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
        int err, ret = NET_XMIT_DROP;
        struct flowi4 fl4 = {
                .flowi4_oif = dev->ifindex,
-               .flowi4_tos = RT_TOS(ip4h->tos),
+               .flowi4_tos = ip4h->tos & INET_DSCP_MASK,
                .flowi4_flags = FLOWI_FLAG_ANYSRC,
                .flowi4_mark = skb->mark,
                .daddr = ip4h->daddr,