[PATCH] net: send SYNACK packet with accepted fwmark

Subsystems: networking [general], networking [tcp], the rest

STALE1874d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2021-07-09 · open the first message on its own page

[PATCH] net: send SYNACK packet with accepted fwmark

From: Alexander Ovechkin <hidden>
Date: 2021-07-09 12:37:34

commit e05a90ec9e16 ("net: reflect mark on tcp syn ack packets")
fixed IPv4 only.

This part is for the IPv6 side.

Signed-off-by: Alexander Ovechkin <redacted>
Acked-by: Dmitry Yakunin <redacted>
---
 net/ipv6/tcp_ipv6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 323989927a0a..0ce52d46e4f8 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -555,7 +555,7 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
 		opt = ireq->ipv6_opt;
 		if (!opt)
 			opt = rcu_dereference(np->opt);
-		err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt,
+		err = ip6_xmit(sk, skb, fl6, skb->mark ? : sk->sk_mark, opt,
 			       tclass, sk->sk_priority);
 		rcu_read_unlock();
 		err = net_xmit_eval(err);
-- 
2.17.1

Re: [PATCH] net: send SYNACK packet with accepted fwmark

From: Eric Dumazet <edumazet@google.com>
Date: 2021-07-09 14:02:15

On Fri, Jul 9, 2021 at 2:35 PM Alexander Ovechkin [off-list ref] wrote:
commit e05a90ec9e16 ("net: reflect mark on tcp syn ack packets")
fixed IPv4 only.

This part is for the IPv6 side.

Signed-off-by: Alexander Ovechkin <redacted>
Acked-by: Dmitry Yakunin <redacted>
Please add a standard tool-friendly Fixes: tag.

Fixes: e05a90ec9e16 ("net: reflect mark on tcp syn ack packets")
quoted hunk
---
 net/ipv6/tcp_ipv6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 323989927a0a..0ce52d46e4f8 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -555,7 +555,7 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
                opt = ireq->ipv6_opt;
                if (!opt)
                        opt = rcu_dereference(np->opt);
-               err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt,
+               err = ip6_xmit(sk, skb, fl6, skb->mark ? : sk->sk_mark, opt,
                               tclass, sk->sk_priority);
                rcu_read_unlock();
                err = net_xmit_eval(err);
--
2.17.1
ip6_xmit() overwrites skb->mark with its 4th argument, while
ip_build_and_send_pkt()
does the write if skb->mark is zero, so your patch seems fine to me, thanks.


Reviewed-by: Eric Dumazet <edumazet@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help