Hi
I have a TCP server that is listening on a particular interface only. I want that after the accept() call if the incoming connection was from xxx.xxx.xxx.0 subnet then the data should go through intf1 otherwise the data should be sent through intf2 which is where my server is listening.
Both the interfaces have the same route settings and priority. All the networks are accessible from both the interfaces.
One way out could be to add a new route through intf1 with higher priority, but I want this to be a code based decision.
The code is in pure C written on Linux.
Thanks for the help.