Skip to content

Commit 2bc9778

Browse files
idoschkuba-moo
authored andcommitted
ipv4: ipmr: Unmask upper DSCP bits in ipmr_rt_fib_lookup()
Unmask the upper DSCP bits when calling ipmr_fib_lookup() so that in the future it could perform the FIB lookup according to the full DSCP value. Note that ipmr_fib_lookup() performs a FIB rule lookup (returning the relevant routing table) and that IPv4 multicast FIB rules do not support matching on TOS / DSCP. However, it is still worth unmasking the upper DSCP bits in case support for DSCP matching is ever added. 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 338385e commit 2bc9778

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/ipmr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include <net/fib_rules.h>
6363
#include <linux/netconf.h>
6464
#include <net/rtnh.h>
65+
#include <net/inet_dscp.h>
6566

6667
#include <linux/nospec.h>
6768

@@ -2080,7 +2081,7 @@ static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
20802081
struct flowi4 fl4 = {
20812082
.daddr = iph->daddr,
20822083
.saddr = iph->saddr,
2083-
.flowi4_tos = RT_TOS(iph->tos),
2084+
.flowi4_tos = iph->tos & INET_DSCP_MASK,
20842085
.flowi4_oif = (rt_is_output_route(rt) ?
20852086
skb->dev->ifindex : 0),
20862087
.flowi4_iif = (rt_is_output_route(rt) ?

0 commit comments

Comments
 (0)