Wrong outgoing interface with multiple routing tables

Julian Elischer julian at elischer.org
Mon Jul 27 23:24:48 UTC 2009


Julian Elischer wrote:
> Oleg Sharoyko wrote:
>>
>> Julian Elischer wrote:
>>
>>> great.. in your simple server, can you do the sockopt on the socket 
>>> AFTER you did the listen()?
>>> (just as a test).
>>
>> Doesn't help. I have also tried to add setsockopt() after accept() 
>> (for a new socket) and in this case the only packet that is being sent 
>> out via wrong interface is the SYN+ACK from server.
>>
>> I'll try to look into the kernel code tomorrow and will report any 
>> findings.
>>
>> -- 
>> Oleg
> 
> 
> in addition to the patches already sent you might like to add the 
> following line to netinet/tcp_input.c
> 
>                 }
>                 inc.inc_fport = th->th_sport;
>                 inc.inc_lport = th->th_dport;
>                 inc.inc_fibnum = so->so_fibnum; <-------------
>                 /*
>                  * Check for an existing connection attempt in syncache if
>                  * the flag is only ACK.  A successful lookup creates a new
>                  * socket appended to the listen queue in SYN_RECEIVED 
> state.
>                  */

in fact you might try just this on its own

> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



More information about the freebsd-net mailing list