From: Guillaume Nault Date: Thu, 16 Jan 2025 13:10:16 +0000 (+0100) Subject: dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion. X-Git-Tag: v6.14-rc1~162^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02673d58adfa51e5e326d7472f251a63f42fcd93;p=thirdparty%2Flinux.git dccp: Prepare dccp_v4_route_skb() to .flowi4_tos conversion. Use inet_sk_dscp() to get the socket DSCP value as dscp_t, instead of ip_sock_rt_tos() which returns a __u8. This will ease the conversion of fl4->flowi4_tos to dscp_t, which now just becomes a matter of dropping the inet_dscp_to_dsfield() call. Signed-off-by: Guillaume Nault Reviewed-by: Eric Dumazet Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/208dc5ca28bb5595d7a545de026bba18b1d63bda.1737032802.git.gnault@redhat.com Signed-off-by: Jakub Kicinski --- diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 5926159a6f204..be515ba821e2d 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -473,7 +474,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk, .flowi4_oif = inet_iif(skb), .daddr = iph->saddr, .saddr = iph->daddr, - .flowi4_tos = ip_sock_rt_tos(sk), + .flowi4_tos = inet_dscp_to_dsfield(inet_sk_dscp(inet_sk(sk))), .flowi4_scope = ip_sock_rt_scope(sk), .flowi4_proto = sk->sk_protocol, .fl4_sport = dccp_hdr(skb)->dccph_dport,