Skip to content

Commit be2e908

Browse files
idoschkuba-moo
authored andcommitted
ipv4: Unmask upper DSCP bits when constructing the Record Route option
The Record Route IP option records the addresses of the routers that routed the packet. In the case of forwarded packets, the kernel performs a route lookup via fib_lookup() and fills in the preferred source address of the matched route. Unmask the upper DSCP bits when performing the lookup so that in the future the lookup could be performed 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 bc52a4e commit be2e908

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
@@ -1263,7 +1263,7 @@ void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt)
12631263
struct flowi4 fl4 = {
12641264
.daddr = iph->daddr,
12651265
.saddr = iph->saddr,
1266-
.flowi4_tos = iph->tos & IPTOS_RT_MASK,
1266+
.flowi4_tos = iph->tos & INET_DSCP_MASK,
12671267
.flowi4_oif = rt->dst.dev->ifindex,
12681268
.flowi4_iif = skb->dev->ifindex,
12691269
.flowi4_mark = skb->mark,

0 commit comments

Comments
 (0)