[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba2759c3-7f51-231c-7231-b200559946b8@gmail.com>
Date: Mon, 7 May 2018 15:20:15 -0600
From: David Ahern <dsahern@...il.com>
To: Ben Greear <greearb@...delatech.com>,
Damir Mansurov <dnman@...etlabs.ru>, netdev@...r.kernel.org
Cc: Konstantin Ushakov <kostik@...etlabs.ru>,
"Alexandra N. Kossovsky" <Alexandra.Kossovsky@...etlabs.ru>,
Andrey Dmitrov <andrey.dmitrov@...etlabs.ru>
Subject: Re: The SO_BINDTODEVICE was set to the desired interface, but packets
are received from all interfaces.
On 5/7/18 10:14 AM, Ben Greear wrote:
> On 05/07/2018 03:19 AM, Damir Mansurov wrote:
>>
>> Greetings,
>>
>> After successful call of the setsockopt(SO_BINDTODEVICE) function to
>> set data reception from only one interface, the data is still received
>> from all interfaces.
>> Function setsockopt() returns 0 but then recv() receives data from all
>> available network interfaces.
>>
>> The problem is reproducible on linux kernels 4.14 - 4.16, but it does
>> not on linux kernels 4.4, 4.13.
>>
>> I have written C-code to reproduce this issue (see attached files
>> b2d_send.c and b2d_recv.c). See below explanation of tested
>> configuration.
>
> Hello,
>
> I am not sure if this is your problem or not, but if you are using VRF,
> then you need
> to call SO_BINDTODEVICE before you do the 'normal' bind() call.
>
This is a different problem -- socket lookup is matching when it should not.
Powered by blists - more mailing lists