kernel_optimize_test/include/net/netns
Lorenzo Colitti 84f39b08d7 net: support marking accepting TCP sockets
When using mark-based routing, sockets returned from accept()
may need to be marked differently depending on the incoming
connection request.

This is the case, for example, if different socket marks identify
different networks: a listening socket may want to accept
connections from all networks, but each connection should be
marked with the network that the request came in on, so that
subsequent packets are sent on the correct network.

This patch adds a sysctl to mark TCP sockets based on the fwmark
of the incoming SYN packet. If enabled, and an unmarked socket
receives a SYN, then the SYN packet's fwmark is written to the
connection's inet_request_sock, and later written back to the
accepted socket when the connection is established.  If the
socket already has a nonzero mark, then the behaviour is the same
as it is today, i.e., the listening socket's fwmark is used.

Black-box tested using user-mode linux:

- IPv4/IPv6 SYN+ACK, FIN, etc. packets are routed based on the
  mark of the incoming SYN packet.
- The socket returned by accept() is marked with the mark of the
  incoming SYN packet.
- Tested with syncookies=1 and syncookies=2.

Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-13 18:35:09 -04:00
..
conntrack.h netfilter: conntrack: remove central spinlock nf_conntrack_lock 2014-03-07 11:41:13 +01:00
core.h
dccp.h
generic.h
hash.h
ieee802154_6lowpan.h 6lowpan: handling 6lowpan fragmentation via inet_frag api 2014-02-28 17:05:22 -05:00
ipv4.h net: support marking accepting TCP sockets 2014-05-13 18:35:09 -04:00
ipv6.h net: add a sysctl to reflect the fwmark on replies 2014-05-13 18:35:08 -04:00
mib.h
netfilter.h
nftables.h netfilter: nf_tables: add "inet" table for IPv4/IPv6 2014-01-07 23:57:25 +01:00
packet.h
sctp.h Revert "net: sctp: convert sctp_checksum_disable module param into sctp sysctl" 2013-08-09 13:09:41 -07:00
unix.h
x_tables.h
xfrm.h flowcache: restore a single flow_cache kmem_cache 2014-03-10 21:45:11 -04:00