diff mbox series

[net-next] ipv4: Remove RTO_ONLINK.

Message ID 57de760565cab55df7b129f523530ac6475865b2.1712754146.git.gnault@redhat.com (mailing list archive)
State Accepted
Commit 5618603f5d063c8d769d2e64cd440f787567fd13
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ipv4: Remove RTO_ONLINK. | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2701 this patch: 2701
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 984 this patch: 984
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2891 this patch: 2891
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 40 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-12--03-00 (tests: 961)

Commit Message

Guillaume Nault April 10, 2024, 1:14 p.m. UTC
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(-)

Comments

Przemek Kitszel April 10, 2024, 1:22 p.m. UTC | #1
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>
David Ahern April 10, 2024, 2:41 p.m. UTC | #2
On 4/10/24 7:14 AM, 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(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org April 12, 2024, 3:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 10 Apr 2024 15:14:29 +0200 you 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().
> 
> [...]

Here is the summary with links:
  - [net-next] ipv4: Remove RTO_ONLINK.
    https://git.kernel.org/netdev/net-next/c/5618603f5d06

You are awesome, thank you!
diff mbox series

Patch

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);