From: David Ahern <dsahern@gmail.com>
To: Ben Greear <greearb@candelatech.com>,
Damir Mansurov <dnman@oktetlabs.ru>,
netdev@vger.kernel.org
Cc: Konstantin Ushakov <kostik@oktetlabs.ru>,
"Alexandra N. Kossovsky" <Alexandra.Kossovsky@oktetlabs.ru>,
Andrey Dmitrov <andrey.dmitrov@oktetlabs.ru>
Subject: Re: The SO_BINDTODEVICE was set to the desired interface, but packets are received from all interfaces.
Date: Mon, 7 May 2018 15:20:15 -0600 [thread overview]
Message-ID: <ba2759c3-7f51-231c-7231-b200559946b8@gmail.com> (raw)
In-Reply-To: <5361bef8-bdf9-af3d-12ae-a128b6502d2e@candelatech.com>
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.
prev parent reply other threads:[~2018-05-07 21:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-07 10:19 The SO_BINDTODEVICE was set to the desired interface, but packets are received from all interfaces Damir Mansurov
2018-05-07 12:41 ` Paolo Abeni
2018-05-07 15:23 ` David Ahern
2018-05-08 22:48 ` David Ahern
2018-05-07 16:14 ` Ben Greear
2018-05-07 21:20 ` David Ahern [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba2759c3-7f51-231c-7231-b200559946b8@gmail.com \
--to=dsahern@gmail.com \
--cc=Alexandra.Kossovsky@oktetlabs.ru \
--cc=andrey.dmitrov@oktetlabs.ru \
--cc=dnman@oktetlabs.ru \
--cc=greearb@candelatech.com \
--cc=kostik@oktetlabs.ru \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).