All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL nf] IPVS fixes for v3.10
@ 2013-05-25 23:16 Simon Horman
  2013-05-25 23:16 ` [PATCH] ipvs: Fix reuse connection if real server is dead Simon Horman
  0 siblings, 1 reply; 14+ messages in thread
From: Simon Horman @ 2013-05-25 23:16 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
	Julian Anastasov

Hi Pablo,

The following changes since commit 4f36ea6eed2081340c7a7aa98c73187ecfccebff:

  netfilter: ipt_ULOG: fix non-null terminated string in the nf_log path (2013-05-23 14:25:40 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git tags/ipvs-fixes-for-v3.10

for you to fetch changes up to 1fb4f80a593231770eae3192e4a52fa7631bd897:

  ipvs: Fix reuse connection if real server is dead (2013-05-26 08:10:47 +0900)

----------------------------------------------------------------
IPVS fixes for v3.10

Correct connection reuse for TCP and SCTP

----------------------------------------------------------------
Grzegorz Lyczba (1):
      ipvs: Fix reuse connection if real server is dead

 net/netfilter/ipvs/ip_vs_core.c |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] ipvs: Fix reuse connection if real server is dead
@ 2013-05-07 21:54 Grzegorz Lyczba
  2013-05-08  6:12 ` Hans Schillstrom
  2013-05-08  7:35 ` Julian Anastasov
  0 siblings, 2 replies; 14+ messages in thread
From: Grzegorz Lyczba @ 2013-05-07 21:54 UTC (permalink / raw)
  To: lvs-devel; +Cc: Grzegorz Lyczba, Julian Anastasov, Simon Horman

Expire cached connection for new TCP connection if real server is down

Signed-off-by: Grzegorz Lyczba <grzegorz.lyczba@gmail.com>
---
 net/netfilter/ipvs/ip_vs_core.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 47edf5a..7c5f083 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1002,6 +1002,17 @@ static inline int is_tcp_reset(const struct sk_buff *skb, int nh_len)
 	return th->rst;
 }
 
+static inline int is_tcp_syn(const struct sk_buff *skb, int nh_len)
+{
+    struct tcphdr _tcph, *th;
+
+    th = skb_header_pointer(skb, nh_len, sizeof(_tcph), &_tcph);
+    if (th == NULL)
+        return 0;
+    return th->syn;
+}
+
+
 /* Handle response packets: rewrite addresses and send away...
  */
 static unsigned int
@@ -1627,6 +1638,15 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
 	 * Check if the packet belongs to an existing connection entry
 	 */
 	cp = pp->conn_in_get(af, skb, &iph, 0);
+
+	if (likely(cp) && likely(cp->dest) &&
+	    unlikely(!atomic_read(&cp->dest->weight)) &&
+	    iph.protocol == IPPROTO_TCP && is_tcp_syn(skb, iph.len)) {
+		ip_vs_conn_expire_now(cp);
+		__ip_vs_conn_put(cp);
+		cp = NULL;
+	}
+
 	if (unlikely(!cp) && !iph.fragoffs) {
 		/* No (second) fragments need to enter here, as nf_defrag_ipv6
 		 * replayed fragment zero will already have created the cp
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-05-27 23:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-25 23:16 [GIT PULL nf] IPVS fixes for v3.10 Simon Horman
2013-05-25 23:16 ` [PATCH] ipvs: Fix reuse connection if real server is dead Simon Horman
2013-05-27 11:49   ` Pablo Neira Ayuso
2013-05-27 23:48     ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2013-05-07 21:54 Grzegorz Lyczba
2013-05-08  6:12 ` Hans Schillstrom
2013-05-08  7:35 ` Julian Anastasov
2013-05-08  8:07   ` Hans Schillstrom
2013-05-08  8:53     ` Julian Anastasov
2013-05-08  9:21       ` Hans Schillstrom
2013-05-11  9:32   ` Grzegorz Łyczba
2013-05-11 13:23     ` Julian Anastasov
2013-05-13  1:38       ` Simon Horman
2013-05-13 13:38       ` Jesper Dangaard Brouer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.