ipv4: ipmr: Unmask upper DSCP bits in ipmr_queue_xmit()
authorIdo Schimmel <idosch@nvidia.com>
Tue, 3 Sep 2024 13:53:25 +0000 (16:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Sep 2024 23:57:11 +0000 (16:57 -0700)
Unmask the upper DSCP bits when calling ip_route_output_ports() 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>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20240903135327.2810535-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/ipmr.c

index f1a43199551b96144feb4e14acbf14bd2cd7edf2..089864c6a35eec146a1ba90c22d79245f8e48158 100644 (file)
@@ -1869,7 +1869,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
                                           vif->remote, vif->local,
                                           0, 0,
                                           IPPROTO_IPIP,
-                                          RT_TOS(iph->tos), vif->link);
+                                          iph->tos & INET_DSCP_MASK, vif->link);
                if (IS_ERR(rt))
                        goto out_free;
                encap = sizeof(struct iphdr);
@@ -1877,7 +1877,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
                rt = ip_route_output_ports(net, &fl4, NULL, iph->daddr, 0,
                                           0, 0,
                                           IPPROTO_IPIP,
-                                          RT_TOS(iph->tos), vif->link);
+                                          iph->tos & INET_DSCP_MASK, vif->link);
                if (IS_ERR(rt))
                        goto out_free;
        }