Re: [PATCH v2 01/11] RDMA/CMA: Mark IPv4 addresses correctly when the listener is IPv6

Haggai Eran
2015-04-21T10:15:11Z

On 20/04/2015 23:01, Jason Gunthorpe wrote:
> On Mon, Apr 20, 2015 at 09:38:02PM +0300, Or Gerlitz wrote:
>> On Mon, Apr 20, 2015 at 7:41 PM, Jason Gunthorpe
>> <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
>>> On Mon, Apr 20, 2015 at 12:03:32PM +0300, Haggai Eran wrote:
>>>> From: Yotam Kenneth <yotamke-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>>>
>>>> When accepting a new connection with the listener being IPv6, the
>>>> family of the new connection is set as IPv6. This causes cma_zero_addr
>>>> function to return true on an non-zero address. As a result, the wrong
>>>> code path is taken. This causes the connection request to be rejected,
>>>> as the RDMA-CM code looks for the wrong type of device.
>>>
>>> This description doesn't really make sense as to what the problem is.
>
>> Jason, could you take a look @ this thread
>> http://marc.info/?t=141589395000004&r=1&w=2 where the authors
>> addressed some comments from Sean and he eventually Acked the patch?
>
> Please actually read my comments:
>
> If listen_id->route.addr.src_addr.ss_family != AF_INET then it is
> invalid to cast to sockaddr_in.

That's correct. We didn't address it because it was part of the existing
code. Anyway, in a later patch in this series we move this code from the
CMA to the CM module. Then we get the port number from the service ID
instead of from the listener ID, since the listener ID's port isn't
available.

>
> Sean asked basically the same thing, and his question was ignored too.
>
> This should take care of it, testing, and figuring the fixes tag is
> left as an exercise to the reader..
>

Fixes: e51060f08a61 ("IB: IP address based RDMA connection manager")
Tested-by: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Haggai