linux/net/ipv6
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
..
netfilter net: rename local_df to ignore_df 2014-05-12 14:03:41 -04:00
Kconfig
Makefile
addrconf.c net: clean up snmp stats code 2014-05-07 16:06:05 -04:00
addrconf_core.c net: clean up snmp stats code 2014-05-07 16:06:05 -04:00
addrlabel.c
af_inet6.c net: clean up snmp stats code 2014-05-07 16:06:05 -04:00
ah6.c ah6: Use the IPsec protocol multiplexer API 2014-03-14 07:28:07 +01:00
anycast.c
datagram.c
esp6.c
exthdrs.c
exthdrs_core.c
exthdrs_offload.c
fib6_rules.c
icmp.c net: add a sysctl to reflect the fwmark on replies 2014-05-13 18:35:08 -04:00
inet6_connection_sock.c net: support marking accepting TCP sockets 2014-05-13 18:35:09 -04:00
inet6_hashtables.c
ip6_checksum.c net: Implmement RFC 6936 (zero RX csums for UDP/IPv6) 2014-05-05 15:26:30 -04:00
ip6_fib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-12 13:19:14 -04:00
ip6_flowlabel.c net: ipv6: Introduce ip6_sk_dst_hoplimit. 2014-04-30 13:31:26 -04:00
ip6_gre.c gre6: Call skb_checksum_simple_validate 2014-05-08 23:47:50 -04:00
ip6_icmp.c
ip6_input.c
ip6_offload.c
ip6_offload.h
ip6_output.c net: rename local_df to ignore_df 2014-05-12 14:03:41 -04:00
ip6_tunnel.c ip6_tunnel: use the right netns in ioctl handler 2014-04-16 15:16:02 -04:00
ip6_vti.c vti6: Enable namespace changing 2014-03-14 07:28:09 +01:00
ip6mr.c net: ipv6: more places need LOOPBACK_IFINDEX for flowi6_iif 2014-04-28 14:47:03 -04:00
ipcomp6.c ipcomp6: Use the IPsec protocol multiplexer API 2014-03-14 07:28:07 +01:00
ipv6_sockglue.c
mcast.c ipv6: some ipv6 statistic counters failed to disable bh 2014-03-31 16:38:12 -04:00
mip6.c
ndisc.c
netfilter.c netfilter: Fix potential use after free in ip6_route_me_harder() 2014-05-09 02:36:39 +02:00
output_core.c ipv6: strengthen fallback fragmentation id generation 2014-03-31 16:33:38 -04:00
ping.c net: ipv6: Introduce ip6_sk_dst_hoplimit. 2014-04-30 13:31:26 -04:00
proc.c net: clean up snmp stats code 2014-05-07 16:06:05 -04:00
protocol.c
raw.c net: ipv6: Introduce ip6_sk_dst_hoplimit. 2014-04-30 13:31:26 -04:00
reassembly.c
route.c net: Use fwmark reflection in PMTU discovery. 2014-05-13 18:35:09 -04:00
sit.c sit: use the right netns in ioctl handler 2014-04-16 15:16:02 -04:00
syncookies.c net: support marking accepting TCP sockets 2014-05-13 18:35:09 -04:00
sysctl_net_ipv6.c net: add a sysctl to reflect the fwmark on replies 2014-05-13 18:35:08 -04:00
tcp_ipv6.c net: support marking accepting TCP sockets 2014-05-13 18:35:09 -04:00
tcpv6_offload.c
tunnel6.c
udp.c net: Verify UDP checksum before handoff to encap 2014-05-08 23:47:50 -04:00
udp_impl.h
udp_offload.c
udplite.c
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c xfrm6: Remove xfrm_tunnel_notifier 2014-03-14 07:28:08 +01:00
xfrm6_output.c net: rename local_df to ignore_df 2014-05-12 14:03:41 -04:00
xfrm6_policy.c
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c