remarkable-linux/include
Julian Anastasov 7361f006e3 ipvs: drop first packet to redirect conntrack
[ Upstream commit f719e3754e ]

Jiri Bohac is reporting for a problem where the attempt
to reschedule existing connection to another real server
needs proper redirect for the conntrack used by the IPVS
connection. For example, when IPVS connection is created
to NAT-ed real server we alter the reply direction of
conntrack. If we later decide to select different real
server we can not alter again the conntrack. And if we
expire the old connection, the new connection is left
without conntrack.

So, the only way to redirect both the IPVS connection and
the Netfilter's conntrack is to drop the SYN packet that
hits existing connection, to wait for the next jiffie
to expire the old connection and its conntrack and to rely
on client's retransmission to create new connection as
usually.

Jiri Bohac provided a fix that drops all SYNs on rescheduling,
I extended his patch to do such drops only for connections
that use conntrack. Here is the original report from Jiri Bohac:

Since commit dc7b3eb900 ("ipvs: Fix reuse connection if real server
is dead"), new connections to dead servers are redistributed
immediately to new servers.  The old connection is expired using
ip_vs_conn_expire_now() which sets the connection timer to expire
immediately.

However, before the timer callback, ip_vs_conn_expire(), is run
to clean the connection's conntrack entry, the new redistributed
connection may already be established and its conntrack removed
instead.

Fix this by dropping the first packet of the new connection
instead, like we do when the destination server is not available.
The timer will have deleted the old conntrack entry long before
the first packet of the new connection is retransmitted.

Fixes: dc7b3eb900 ("ipvs: Fix reuse connection if real server is dead")
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-07-10 23:07:16 -04:00
..
acpi
asm-generic SIGNAL: Move generic copy_siginfo() to signal.h 2016-06-06 19:12:20 -04:00
clocksource
crypto crypto: af_alg - Allow af_af_alg_release_parent to be called on nokey path 2016-02-03 16:23:19 -05:00
drm drm: Loongson-3 doesn't fully support wc memory 2016-05-10 12:17:32 -04:00
dt-bindings
keys
kvm
linux net: validate variable length ll headers 2016-07-10 23:07:01 -04:00
math-emu
media
memory
misc
net ipvs: drop first packet to redirect conntrack 2016-07-10 23:07:16 -04:00
pcmcia
ras
rdma IB/security: Restrict use of the write() interface 2016-05-17 13:42:48 -04:00
rxrpc
scsi Revert "libata-eh: Set 'information' field for autosense" 2015-09-13 09:07:46 -07:00
soc iommu/tegra-smmu: Parameterize number of TLB lines 2015-09-29 19:26:14 +02:00
sound ALSA: hda - Fix possible race on regmap bypass flip 2016-07-10 20:19:59 -04:00
target target: Fix remote-port TMR ABORT + se_cmd fabric stop 2016-03-05 22:11:42 -05:00
trace net: sunrpc: fix tracepoint Warning: unknown op '->' 2015-09-29 19:26:10 +02:00
uapi [media] v4l2-dv-timings.h: fix polarity for 4k formats 2016-05-17 13:42:40 -04:00
video
xen x86/xen: Support kexec/kdump in HVM guests by doing a soft reset 2015-10-22 14:43:14 -07:00
Kbuild