linux-sg2042/net/netfilter/ipvs
Marco Angaroni 3ec10d3a2b ipvs: update real-server binding of outgoing connections in SIP-pe
Previous patch that introduced handling of outgoing packets in SIP
persistent-engine did not call ip_vs_check_template() in case packet was
matching a connection template. Assumption was that real-server was
healthy, since it was sending a packet just in that moment.

There are however real-server fault conditions requiring that association
between call-id and real-server (represented by connection template)
gets updated. Here is an example of the sequence of events:
  1) RS1 is a back2back user agent that handled call-id1 and call-id2
  2) RS1 is down and was marked as unavailable
  3) new message from outside comes to IPVS with call-id1
  4) IPVS reschedules the message to RS2, which becomes new call handler
  5) RS2 forwards the message outside, translating call-id1 to call-id2
  6) inside pe->conn_out() IPVS matches call-id2 with existing template
  7) IPVS does not change association call-id2 <-> RS1
  8) new message comes from client with call-id2
  9) IPVS reschedules the message to a real-server potentially different
     from RS2, which is now the correct destination

This patch introduces ip_vs_check_template() call in the handling of
outgoing packets for SIP-pe. And also introduces a second optional
argument for ip_vs_check_template() that allows to check if dest
associated to a connection template is the same dest that was identified
as the source of the packet. This is to change the real-server bound to a
particular call-id independently from its availability status: the idea
is that it's more reliable, for in->out direction (where internal
network can be considered trusted), to always associate a call-id with
the last real-server that used it in one of its messages. Think about
above sequence of events where, just after step 5, RS1 returns instead
to be available.

Comparison of dests is done by simply comparing pointers to struct
ip_vs_dest; there should be no cases where struct ip_vs_dest keeps its
memory address, but represent a different real-server in terms of
ip-address / port.

Fixes: 39b9722315 ("ipvs: handle connections started by real-servers")
Signed-off-by: Marco Angaroni <marcoangaroni@gmail.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-06 09:47:25 +09:00
..
Kconfig ipvs: Add ovf scheduler 2015-08-21 09:08:39 -07:00
Makefile ipvs: Add ovf scheduler 2015-08-21 09:08:39 -07:00
ip_vs_app.c netfilter: ipvs: avoid unused variable warnings 2016-02-18 09:17:58 +09:00
ip_vs_conn.c ipvs: update real-server binding of outgoing connections in SIP-pe 2016-06-06 09:47:25 +09:00
ip_vs_core.c ipvs: update real-server binding of outgoing connections in SIP-pe 2016-06-06 09:47:25 +09:00
ip_vs_ctl.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2016-05-09 15:02:58 -04:00
ip_vs_dh.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_est.c ipvs: Pass ipvs not net to ip_vs_estimator_net_init and ip_vs_estimator_cleanup 2015-09-24 09:34:39 +09:00
ip_vs_fo.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_ftp.c ipvs: Remove net argument from ip_vs_tcp_conn_listen 2015-09-24 09:34:43 +09:00
ip_vs_lblc.c ipvs: Store ipvs not net in struct ip_vs_service 2015-09-24 09:34:33 +09:00
ip_vs_lblcr.c ipvs: Store ipvs not net in struct ip_vs_service 2015-09-24 09:34:33 +09:00
ip_vs_lc.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_nfct.c ipvs: don't alter conntrack in OPS mode 2016-04-20 12:34:17 +10:00
ip_vs_nq.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_ovf.c ipvs: Add ovf scheduler 2015-08-21 09:08:39 -07:00
ip_vs_pe.c netfilter: Deletion of unnecessary checks before two function calls 2014-11-20 13:08:43 +01:00
ip_vs_pe_sip.c ipvs: handle connections started by real-servers 2016-04-20 12:34:17 +10:00
ip_vs_proto.c ipvs: Pass ipvs not net to ip_vs_protocol_net_(init|cleanup) 2015-09-24 09:34:43 +09:00
ip_vs_proto_ah_esp.c ipvs: Pass ipvs into .conn_schedule and ip_vs_try_to_schedule 2015-09-24 09:34:41 +09:00
ip_vs_proto_sctp.c sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC 2015-12-15 16:49:58 -05:00
ip_vs_proto_tcp.c ipvs: Remove net argument from ip_vs_tcp_conn_listen 2015-09-24 09:34:43 +09:00
ip_vs_proto_udp.c ipvs: Pass ipvs into .conn_schedule and ip_vs_try_to_schedule 2015-09-24 09:34:41 +09:00
ip_vs_rr.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_sched.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2015-08-04 23:57:45 -07:00
ip_vs_sed.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_sh.c ipvs: sh: support scheduling icmp/inverse packets consistently 2015-09-01 10:33:52 +09:00
ip_vs_sync.c ipvs: Pass ipvs not net to ip_vs_sync_net_cleanup 2015-09-24 09:34:38 +09:00
ip_vs_wlc.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_wrr.c ipvs: use correct address family in scheduler logs 2014-09-18 08:59:23 +09:00
ip_vs_xmit.c net: define gso types for IPx over IPv4 and IPv6 2016-05-20 18:03:15 -04:00