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.