LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH 2/2] ipvs: Fix reuse connection if real server is dead

To: Simon Horman <horms@xxxxxxxxxxxx>
Subject: Re: [PATCH 2/2] ipvs: Fix reuse connection if real server is dead
Cc: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Grzegorz Lyczba <grzegorz.lyczba@xxxxxxxxx>
From: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>
Date: Wed, 22 May 2013 22:11:35 +0400
Hello.

On 22-05-2013 9:56, Simon Horman wrote:

From: Grzegorz Lyczba <grzegorz.lyczba@xxxxxxxxx>

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

Signed-off-by: Grzegorz Lyczba <grzegorz.lyczba@xxxxxxxxx>
Acked-by Hans Schillstrom <hans@xxxxxxxxxxxxxxx>

   Missing :.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
  net/netfilter/ipvs/ip_vs_core.c | 36 ++++++++++++++++++++++++++++++++++++
  1 file changed, 36 insertions(+)

diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 085b588..7967d12 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1001,6 +1001,33 @@ static inline int is_tcp_reset(const struct sk_buff 
*skb, int nh_len)
        return th->rst;
  }

+static inline bool is_new_conn(const struct sk_buff *skb,
+                              struct ip_vs_iphdr *iph)
+{
+       switch (iph->protocol) {
+       case IPPROTO_TCP: {
+               struct tcphdr _tcph, *th;
+
+               th = skb_header_pointer(skb, iph->len, sizeof(_tcph), &_tcph);
+               if (th == NULL)
+                       return false;
+               return th->syn;
+       }
+       case IPPROTO_SCTP: {
+               sctp_chunkhdr_t *sch, schunk;
+
+               sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t),
+                               sizeof(schunk), &schunk);

   This line should be aligned under the next character after (.

+               if (sch == NULL)
+                       return false;
+               return (sch->type == SCTP_CID_INIT);

   () not needed.

+       }
+       default:
+               return false;
+       }
+}
+
+

   Too many empty lines?

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>