Skip to content

Commit be8b8de

Browse files
idoschkuba-moo
authored andcommitted
ipv4: Unmask upper DSCP bits when using hints
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 <[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 b6791ac commit be8b8de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ int ip_route_use_hint(struct sk_buff *skb, __be32 daddr, __be32 saddr,
21602160
if (rt->rt_type != RTN_LOCAL)
21612161
goto skip_validate_source;
21622162

2163-
tos &= IPTOS_RT_MASK;
2163+
tos &= INET_DSCP_MASK;
21642164
err = fib_validate_source(skb, saddr, daddr, tos, 0, dev, in_dev, &tag);
21652165
if (err < 0)
21662166
goto martian_source;

0 commit comments

Comments
 (0)