Skip to content

Commit 02673d5

Browse files
Guillaume Naultkuba-moo
authored andcommitted
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 <gnault@redhat.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/208dc5ca28bb5595d7a545de026bba18b1d63bda.1737032802.git.gnault@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 54ea680 commit 02673d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/dccp/ipv4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <net/icmp.h>
1717
#include <net/inet_common.h>
18+
#include <net/inet_dscp.h>
1819
#include <net/inet_hashtables.h>
1920
#include <net/inet_sock.h>
2021
#include <net/protocol.h>
@@ -473,7 +474,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
473474
.flowi4_oif = inet_iif(skb),
474475
.daddr = iph->saddr,
475476
.saddr = iph->daddr,
476-
.flowi4_tos = ip_sock_rt_tos(sk),
477+
.flowi4_tos = inet_dscp_to_dsfield(inet_sk_dscp(inet_sk(sk))),
477478
.flowi4_scope = ip_sock_rt_scope(sk),
478479
.flowi4_proto = sk->sk_protocol,
479480
.fl4_sport = dccp_hdr(skb)->dccph_dport,

0 commit comments

Comments
 (0)