netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Guillaume Nault <gnault@redhat.com>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"Eric Dumazet" <edumazet@google.com>
Cc: <netdev@vger.kernel.org>, David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH net-next] ipv4: Remove RTO_ONLINK.
Date: Wed, 10 Apr 2024 15:22:52 +0200	[thread overview]
Message-ID: <c37bf2ba-c657-462e-81e6-2d065eacc8eb@intel.com> (raw)
In-Reply-To: <57de760565cab55df7b129f523530ac6475865b2.1712754146.git.gnault@redhat.com>

On 4/10/24 15:14, Guillaume Nault wrote:
> RTO_ONLINK was a flag used in ->flowi4_tos that allowed to alter the
> scope of an IPv4 route lookup. Setting this flag was equivalent to
> specifying RT_SCOPE_LINK in ->flowi4_scope.
> 
> With commit ec20b2830093 ("ipv4: Set scope explicitly in
> ip_route_output()."), the last users of RTO_ONLINK have been removed.
> Therefore, we can now drop the code that checked this bit and stop
> modifying ->flowi4_scope in ip_route_output_key_hash().
> 
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
> ---
>   include/net/route.h |  2 --
>   net/ipv4/route.c    | 14 +-------------
>   2 files changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/include/net/route.h b/include/net/route.h
> index 315a8acee6c6..630d1ef6868a 100644
> --- a/include/net/route.h
> +++ b/include/net/route.h
> @@ -35,8 +35,6 @@
>   #include <linux/cache.h>
>   #include <linux/security.h>
>   
> -#define RTO_ONLINK	0x01
> -
>   static inline __u8 ip_sock_rt_scope(const struct sock *sk)
>   {
>   	if (sock_flag(sk, SOCK_LOCALROUTE))
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index c8f76f56dc16..bc6759e07a6f 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -106,9 +106,6 @@
>   
>   #include "fib_lookup.h"
>   
> -#define RT_FL_TOS(oldflp4) \
> -	((oldflp4)->flowi4_tos & (IPTOS_RT_MASK | RTO_ONLINK))
> -
>   #define RT_GC_TIMEOUT (300*HZ)
>   
>   #define DEFAULT_MIN_PMTU (512 + 20 + 20)
> @@ -498,15 +495,6 @@ void __ip_select_ident(struct net *net, struct iphdr *iph, int segs)
>   }
>   EXPORT_SYMBOL(__ip_select_ident);
>   
> -static void ip_rt_fix_tos(struct flowi4 *fl4)
> -{
> -	__u8 tos = RT_FL_TOS(fl4);
> -
> -	fl4->flowi4_tos = tos & IPTOS_RT_MASK;
> -	if (tos & RTO_ONLINK)
> -		fl4->flowi4_scope = RT_SCOPE_LINK;
> -}
> -
>   static void __build_flow_key(const struct net *net, struct flowi4 *fl4,
>   			     const struct sock *sk, const struct iphdr *iph,
>   			     int oif, __u8 tos, u8 prot, u32 mark,
> @@ -2638,7 +2626,7 @@ struct rtable *ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
>   	struct rtable *rth;
>   
>   	fl4->flowi4_iif = LOOPBACK_IFINDEX;
> -	ip_rt_fix_tos(fl4);
> +	fl4->flowi4_tos &= IPTOS_RT_MASK;
>   
>   	rcu_read_lock();
>   	rth = ip_route_output_key_hash_rcu(net, fl4, &res, skb);

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

  reply	other threads:[~2024-04-10 13:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 13:14 [PATCH net-next] ipv4: Remove RTO_ONLINK Guillaume Nault
2024-04-10 13:22 ` Przemek Kitszel [this message]
2024-04-10 14:41 ` David Ahern
2024-04-12  3:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c37bf2ba-c657-462e-81e6-2d065eacc8eb@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gnault@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).