lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4d7FqLVGI4oUh3s@shredder>
Date: Wed, 15 Jan 2025 11:08:38 +0200
From: Ido Schimmel <idosch@...dia.com>
To: Guillaume Nault <gnault@...hat.com>
Cc: David Miller <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>,
	netdev@...r.kernel.org, Simon Horman <horms@...nel.org>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	Harald Welte <laforge@...monks.org>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	osmocom-net-gprs@...ts.osmocom.org
Subject: Re: [PATCH net-next] gtp: Prepare ip4_route_output_gtp() to
 .flowi4_tos conversion.

On Tue, Jan 14, 2025 at 05:12:12PM +0100, Guillaume Nault wrote:
> 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, as it will just require to drop the
> inet_dscp_to_dsfield() call.
> 
> Signed-off-by: Guillaume Nault <gnault@...hat.com>
> ---
>  drivers/net/gtp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
> index 89a996ad8cd0..03d886014f5a 100644
> --- a/drivers/net/gtp.c
> +++ b/drivers/net/gtp.c
> @@ -23,6 +23,8 @@
>  
>  #include <net/net_namespace.h>
>  #include <net/protocol.h>
> +#include <net/inet_dscp.h>
> +#include <net/inet_sock.h>
>  #include <net/ip.h>
>  #include <net/ipv6.h>
>  #include <net/udp.h>
> @@ -350,7 +352,7 @@ static struct rtable *ip4_route_output_gtp(struct flowi4 *fl4,
>  	fl4->flowi4_oif		= sk->sk_bound_dev_if;
>  	fl4->daddr		= daddr;
>  	fl4->saddr		= saddr;
> -	fl4->flowi4_tos		= ip_sock_rt_tos(sk);
> +	fl4->flowi4_tos		= inet_dscp_to_dsfield(inet_sk_dscp(inet_sk((sk))));

There seems to be an unnecessary pair of parenthesis here like in the
other patch. I assume you will take care of that in v2?

>  	fl4->flowi4_scope	= ip_sock_rt_scope(sk);
>  	fl4->flowi4_proto	= sk->sk_protocol;
>  
> -- 
> 2.39.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ