Skip to content

Commit b6791ac

Browse files
idoschkuba-moo
authored andcommitted
ipv4: udp: Unmask upper DSCP bits during early demux
Unmask the upper DSCP bits when performing source validation for multicast packets during early demux. In the future, this will allow us to perform the FIB lookup which 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 1c6f50b commit b6791ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/udp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
#include <net/addrconf.h>
116116
#include <net/udp_tunnel.h>
117117
#include <net/gro.h>
118+
#include <net/inet_dscp.h>
118119
#if IS_ENABLED(CONFIG_IPV6)
119120
#include <net/ipv6_stubs.h>
120121
#endif
@@ -2618,7 +2619,7 @@ int udp_v4_early_demux(struct sk_buff *skb)
26182619
if (!inet_sk(sk)->inet_daddr && in_dev)
26192620
return ip_mc_validate_source(skb, iph->daddr,
26202621
iph->saddr,
2621-
iph->tos & IPTOS_RT_MASK,
2622+
iph->tos & INET_DSCP_MASK,
26222623
skb->dev, in_dev, &itag);
26232624
}
26242625
return 0;

0 commit comments

Comments
 (0)