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] [day] [month] [year] [list]
Message-ID: <20251017090101.GA80913@j66a10360.sqa.eu95>
Date: Fri, 17 Oct 2025 17:01:01 +0800
From: "D. Wythe" <alibuda@...ux.alibaba.com    >
To: Simon Horman <horms@...nel.org>
Cc: "D. Wythe" <alibuda@...ux.alibaba.com>, mjambigi@...ux.ibm.com,
	wenjia@...ux.ibm.com, wintera@...ux.ibm.com,
	dust.li@...ux.alibaba.com, tonylu@...ux.alibaba.com,
	guwen@...ux.alibaba.com, kuba@...nel.org, davem@...emloft.net,
	netdev@...r.kernel.org, linux-s390@...r.kernel.org,
	linux-rdma@...r.kernel.org, pabeni@...hat.com, edumazet@...gle.com,
	sidraya@...ux.ibm.com, jaka@...ux.ibm.com
Subject: Re: [PATCH net-next] net/smc: add full IPv6 support for SMC

On Thu, Oct 16, 2025 at 02:35:39PM +0100, Simon Horman wrote:
> On Thu, Oct 16, 2025 at 01:45:41PM +0800, D. Wythe wrote:
> > The current SMC implementation is IPv4-centric. While it contains a
> > workaround for IPv4-mapped IPv6 addresses, it lacks a functional path
> > for native IPv6, preventing its use in modern dual-stack or IPv6-only
> > networks.
> > 
> > This patch introduces full, native IPv6 support by refactoring the
> > address handling mechanism to be IP-version agnostic, which is
> > achieved by:
> > 
> > - Introducing a generic `struct smc_ipaddr` to abstract IP addresses.
> > - Implementing an IPv6-specific route lookup function.
> > - Extend GID matching logic for both IPv4 and IPv6 addresses
> > 
> > With these changes, SMC can now discover RDMA devices and establish
> > connections over both native IPv4 and IPv6 networks.
> > 
> > Signed-off-by: D. Wythe <alibuda@...ux.alibaba.com>
> > ---
> >  net/smc/af_smc.c   |  35 +++++++----
> >  net/smc/smc_core.h |  40 ++++++++++++-
> >  net/smc/smc_ib.c   | 143 ++++++++++++++++++++++++++++++++++++++-------
> >  net/smc/smc_ib.h   |   9 +++
> >  net/smc/smc_llc.c  |   6 +-
> >  5 files changed, 193 insertions(+), 40 deletions(-)
> > 
> > diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> > index 77b99e8ef35a..cbff0b29ad5b 100644
> > --- a/net/smc/af_smc.c
> > +++ b/net/smc/af_smc.c
> > @@ -1132,12 +1132,9 @@ static int smc_find_proposal_devices(struct smc_sock *smc,
> >  
> >  	/* check if there is an rdma v2 device available */
> >  	ini->check_smcrv2 = true;
> > -	ini->smcrv2.saddr = smc->clcsock->sk->sk_rcv_saddr;
> > +
> > +	smc_ipaddr_from(&ini->smcrv2.saddr, smc->clcsock->sk, sk_rcv_saddr, sk_v6_rcv_saddr);
> 
> Hi,
> 
> Unfortunately this introduces a compilation error when CONFIG_IPV6=n.
> 
> In file included from smc_wr.h:20,
>                  from smc_llc.h:16,
>                  from af_smc.c:47:
> af_smc.c: In function ‘smc_find_proposal_devices’:
> /home/horms/projects/linux/linux/include/net/sock.h:388:37: error: ‘struct sock_common’ has no member named ‘skc_v6_rcv_saddr’; did you mean ‘skc_rcv_saddr’?
>   388 | #define sk_v6_rcv_saddr __sk_common.skc_v6_rcv_saddr
>       |                                     ^~~~~~~~~~~~~~~~
> smc_core.h:639:51: note: in definition of macro ‘smc_ipaddr_from’
>   639 |                         __ipaddr->addr_v6 = __sk->_v6_member;   \
>       |                                                   ^~~~~~~~~~
> af_smc.c:1136:77: note: in expansion of macro ‘sk_v6_rcv_saddr’
>  1136 |         smc_ipaddr_from(&ini->smcrv2.saddr, smc->clcsock->sk, sk_rcv_saddr, sk_v6_rcv_saddr);


Thanks for the report, that's my bad... I will fix it in the next version.

D. Wythe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ