Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipv4: Prepare ip_route_output() to future .flowi4_tos conversion.

Convert the "tos" parameter of ip_route_output() to dscp_t. This way
we'll have a dscp_t value directly available when .flowi4_tos will
eventually be converted to dscp_t.

All ip_route_output() callers but one set this "tos" parameter to 0 and
therefore don't need to be adapted to the new prototype.

Only br_nf_pre_routing_finish() needs conversion. It can just use
ip4h_dscp() to get the DSCP field from the IPv4 header.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/0f10d031dd44c70aae9bc6e19391cb30d5c2fe71.1730928699.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Guillaume Nault and committed by
Jakub Kicinski
48171c65 334fef7a

+4 -4
+3 -3
include/net/route.h
··· 156 156 * structure is only partially set, it may bypass some fib-rules. 157 157 */ 158 158 static inline struct rtable *ip_route_output(struct net *net, __be32 daddr, 159 - __be32 saddr, u8 tos, int oif, 160 - __u8 scope) 159 + __be32 saddr, dscp_t dscp, 160 + int oif, __u8 scope) 161 161 { 162 162 struct flowi4 fl4 = { 163 163 .flowi4_oif = oif, 164 - .flowi4_tos = tos, 164 + .flowi4_tos = inet_dscp_to_dsfield(dscp), 165 165 .flowi4_scope = scope, 166 166 .daddr = daddr, 167 167 .saddr = saddr,
+1 -1
net/bridge/br_netfilter_hooks.c
··· 406 406 goto free_skb; 407 407 408 408 rt = ip_route_output(net, iph->daddr, 0, 409 - iph->tos & INET_DSCP_MASK, 0, 409 + ip4h_dscp(iph), 0, 410 410 RT_SCOPE_UNIVERSE); 411 411 if (!IS_ERR(rt)) { 412 412 /* - Bridged-and-DNAT'ed traffic doesn't