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: <1708412505-34470-14-git-send-email-alibuda@linux.alibaba.com>
Date: Tue, 20 Feb 2024 15:01:38 +0800
From: "D. Wythe" <alibuda@...ux.alibaba.com>
To: kgraul@...ux.ibm.com,
	wenjia@...ux.ibm.com,
	jaka@...ux.ibm.com,
	wintera@...ux.ibm.com,
	guwen@...ux.alibaba.com
Cc: kuba@...nel.org,
	davem@...emloft.net,
	netdev@...r.kernel.org,
	linux-s390@...r.kernel.org,
	linux-rdma@...r.kernel.org,
	tonylu@...ux.alibaba.com,
	pabeni@...hat.com,
	edumazet@...gle.com
Subject: [RFC net-next 13/20] net/smc: embedded tcp sock into smc sock

From: "D. Wythe" <alibuda@...ux.alibaba.com>

For inet version of SMC, one of the key goals is to make
a fallbacked smc sock can be recognazied as a tcp sock by
net tools.

So, it is necessary to embedded the tcp sock into smc sock
and make the tcp sock as the first member of smc sock.

Signed-off-by: D. Wythe <alibuda@...ux.alibaba.com>
---
 net/smc/smc.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/net/smc/smc.h b/net/smc/smc.h
index fce6a7a..932d61f 100644
--- a/net/smc/smc.h
+++ b/net/smc/smc.h
@@ -248,7 +248,11 @@ struct smc_connection {
 };
 
 struct smc_sock {				/* smc sock container */
-	struct sock		sk;
+	union {
+		struct tcp6_sock tp6sk;
+		struct tcp_sock tpsk;
+		struct sock sk;
+	};
 	struct socket		*clcsock;	/* internal tcp socket */
 	void			(*clcsk_state_change)(struct sock *sk);
 						/* original stat_change fct. */
@@ -388,6 +392,11 @@ static inline void smc_sock_set_flag(struct sock *sk, enum sock_flags flag)
 	set_bit(flag, &sk->sk_flags);
 }
 
+static __always_inline bool smc_sock_is_inet_sock(const struct sock *sk)
+{
+	return inet_test_bit(IS_ICSK, sk);
+}
+
 #define smc_sock_flag(sk, flag)	sock_flag(sk, flag)
 
 #endif	/* __SMC_H */
-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ