Re: [PATCH net-next v2 2/2] net/smc: support ipv4 mapped ipv6 addr client for smc-r v2

From: Guangguan Wang
Date: Mon Dec 09 2024 - 07:38:32 EST




On 2024/12/9 17:46, Halil Pasic wrote:
> On Mon, 9 Dec 2024 09:49:23 +0100
> Wenjia Zhang <wenjia@xxxxxxxxxxxxx> wrote:
>
>>> Otherwise, the code below is reasonable.
>>> if (!(ini->smcr_version & SMC_V2) ||
>>> +#if IS_ENABLED(CONFIG_IPV6)
>>> + (smc->clcsock->sk->sk_family == AF_INET6 &&
>>> + !ipv6_addr_v4mapped(&smc->clcsock->sk->sk_v6_rcv_saddr)) ||
>>> +#endif
>>> !smc_clc_ueid_count() ||
>>> smc_find_rdma_device(smc, ini))
>>> ini->smcr_version &= ~SMC_V2;
>>>
>> Ok, I got your point, a socket with an address family other than AF_INET
>> and AF_INET6 is already pre-filtered, so that such extra condition
>> checking for the smc->clcsock->sk->sk_family != AF_INET is not
>> necessary, right?
>>
>> Would you like to send a new version? And feel free to use this in the
>> new version:
>>
>> Reviewed-by: Wenjia Zhang <wenjia@xxxxxxxxxxxxx>
>
> I believe we would like to have a v3 here. Also I'm not sure
> checking on saddr is sufficient, but I didn't do my research on
> that question yet.
>
> Regards,
> Halil

Did you mean to research whether the daddr should be checked too?

Thanks,
Guangguan Wang