From: Guillaume Nault Date: Tue, 22 Oct 2024 09:48:00 +0000 (+0200) Subject: ipv4: Prepare fib_compute_spec_dst() to future .flowi4_tos conversion. X-Git-Tag: v6.13-rc1~135^2~214^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b76ebf22c578375e69b35061b5d47149efd957f9;p=thirdparty%2Fkernel%2Flinux.git ipv4: Prepare fib_compute_spec_dst() to future .flowi4_tos conversion. Use ip4h_dscp() to get the DSCP from the IPv4 header, then convert the dscp_t value to __u8 with inet_dscp_to_dsfield(). Then, when we'll convert .flowi4_tos to dscp_t, we'll just have to drop the inet_dscp_to_dsfield() call. Signed-off-by: Guillaume Nault Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/a0eba69cce94f747e4c7516184a85ffd0abbe3f0.1729530028.git.gnault@redhat.com Signed-off-by: Jakub Kicinski --- diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 53bd26315df52..0c9ce934b4904 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -293,7 +293,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) .flowi4_iif = LOOPBACK_IFINDEX, .flowi4_l3mdev = l3mdev_master_ifindex_rcu(dev), .daddr = ip_hdr(skb)->saddr, - .flowi4_tos = ip_hdr(skb)->tos & INET_DSCP_MASK, + .flowi4_tos = inet_dscp_to_dsfield(ip4h_dscp(ip_hdr(skb))), .flowi4_scope = scope, .flowi4_mark = vmark ? skb->mark : 0, };