Skip to content

Commit 2ce7289

Browse files
Guillaume Naultkuba-moo
authored andcommitted
gtp: Prepare ip4_route_output_gtp() 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: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/06bdb310a075355ff059cd32da2efc29a63981c9.1737034675.git.gnault@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 02673d5 commit 2ce7289

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/gtp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include <net/net_namespace.h>
2525
#include <net/protocol.h>
26+
#include <net/inet_dscp.h>
27+
#include <net/inet_sock.h>
2628
#include <net/ip.h>
2729
#include <net/ipv6.h>
2830
#include <net/udp.h>
@@ -350,7 +352,7 @@ static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4,
350352
fl4->flowi4_oif = sk->sk_bound_dev_if;
351353
fl4->daddr = daddr;
352354
fl4->saddr = saddr;
353-
fl4->flowi4_tos = ip_sock_rt_tos(sk);
355+
fl4->flowi4_tos = inet_dscp_to_dsfield(inet_sk_dscp(inet_sk(sk)));
354356
fl4->flowi4_scope = ip_sock_rt_scope(sk);
355357
fl4->flowi4_proto = sk->sk_protocol;
356358

0 commit comments

Comments
 (0)