All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: Remove more RTO_ONLINK users.
@ 2023-07-17 13:53 ` Guillaume Nault
  0 siblings, 0 replies; 9+ messages in thread
From: Guillaume Nault @ 2023-07-17 13:53 UTC (permalink / raw)
  To: dccp

Code that initialise a flowi4 structure manually before doing a fib
lookup can easily avoid overloading ->flowi4_tos with the RTO_ONLINK
bit. They can just set ->flowi4_scope correctly instead.

Properly separating the routing scope from ->flowi4_tos will allow to
eventually convert this field to dscp_t (to ensure proper separation
between DSCP and ECN).

Guillaume Nault (3):
  gtp: Set TOS and routing scope independently for fib lookups.
  dccp: Set TOS and routing scope independently for fib lookups.
  sctp: Set TOS and routing scope independently for fib lookups.

 drivers/net/gtp.c   | 3 ++-
 net/dccp/ipv4.c     | 3 ++-
 net/sctp/protocol.c | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.39.2

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH net-next 2/3] dccp: Set TOS and routing scope independently for fib lookups.
  2023-07-17 13:53 ` Guillaume Nault
@ 2023-07-17 13:53 ` Guillaume Nault
  -1 siblings, 0 replies; 9+ messages in thread
From: Guillaume Nault @ 2023-07-17 13:53 UTC (permalink / raw)
  To: dccp

There's no reason for setting the RTO_ONLINK flag in ->flowi4_tos as
RT_CONN_FLAGS() does. We can easily set ->flowi4_scope properly
instead. This makes the code more explicit and will allow to convert
->flowi4_tos to dscp_t in the future.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
 net/dccp/ipv4.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index fa8079303cb0..8e919cfe6e23 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -474,7 +474,8 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
 		.flowi4_oif = inet_iif(skb),
 		.daddr = iph->saddr,
 		.saddr = iph->daddr,
-		.flowi4_tos = RT_CONN_FLAGS(sk),
+		.flowi4_tos = ip_sock_rt_tos(sk),
+		.flowi4_scope = ip_sock_rt_scope(sk),
 		.flowi4_proto = sk->sk_protocol,
 		.fl4_sport = dccp_hdr(skb)->dccph_dport,
 		.fl4_dport = dccp_hdr(skb)->dccph_sport,
-- 
2.39.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-19 11:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 13:53 [PATCH net-next 0/3] net: Remove more RTO_ONLINK users Guillaume Nault
2023-07-17 13:53 ` Guillaume Nault
2023-07-17 13:53 ` [PATCH net-next 1/3] gtp: Set TOS and routing scope independently for fib lookups Guillaume Nault
2023-07-17 13:53 ` [PATCH net-next 3/3] sctp: " Guillaume Nault
2023-07-17 16:06   ` Xin Long
2023-07-19 11:40 ` [PATCH net-next 0/3] net: Remove more RTO_ONLINK users patchwork-bot+netdevbpf
2023-07-19 11:40   ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2023-07-17 13:53 [PATCH net-next 2/3] dccp: Set TOS and routing scope independently for fib lookups Guillaume Nault
2023-07-17 13:53 ` Guillaume Nault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.