Wrong outgoing interface with multiple routing tables

Julian Elischer julian at elischer.org
Mon Jul 27 19:52:39 UTC 2009


So there are two possible ways a daemon might assign a fib to a socket 
that it is accepting:

1/  the accept socket could take the FIB of the process.
2/  the accept socket could take the fib of the incoming SYN packet.

I chose #1, but it is possible something in changes between 6
and 7 broke the "chain of custody" for the fib.
This code is in production in 6.x based systems but was only 
introduced to FreeBSD in 7.x.

The process makes a socket which inherits the fib from it.
The socket includes an INET PCB (Protocol Control Block)
which gets a copy too..
when "listen() is called and a syn comes in, a new entry is made in 
the syncache code and this includes a new connection block which is 
supposed to inherrit the fib number from the originating listen socket.

Eventually a new socket is created and it is supposed to inherit teh
fibnum from the syncache entry, and to copy it to the inpcb attached 
to it.

It's possible that somewhere this has been broken by changes.
but I don't see it right at the moment.




More information about the freebsd-net mailing list