LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[patch net-next] ipvs: use pkts for SCTP too

To: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx
Subject: [patch net-next] ipvs: use pkts for SCTP too
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>, Patrick McHardy <kaber@xxxxxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 2 Sep 2010 17:19:14 +0900
From: Julian Anastasov <ja@xxxxxx>

Use correctly the in_pkts packet counter also for SCTP

Signed-off-by: Julian Anastasov <ja@xxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

--- 

Dave, can you take this into net-next?

Index: net-next-2.6/net/netfilter/ipvs/ip_vs_core.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_core.c   2010-09-02 
10:59:53.000000000 +0900
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_core.c        2010-09-02 
11:02:11.000000000 +0900
@@ -1383,8 +1383,7 @@ ip_vs_in(unsigned int hooknum, struct sk
        if (af == AF_INET && (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
            cp->protocol == IPPROTO_SCTP) {
                if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
-                       (atomic_read(&cp->in_pkts) %
-                        sysctl_ip_vs_sync_threshold[1]
+                       (pkts % sysctl_ip_vs_sync_threshold[1]
                         == sysctl_ip_vs_sync_threshold[0])) ||
                                (cp->old_state != cp->state &&
                                 ((cp->state == IP_VS_SCTP_S_CLOSED) ||
@@ -1395,7 +1394,8 @@ ip_vs_in(unsigned int hooknum, struct sk
                }
        }
 
-       if (af == AF_INET &&
+       /* Keep this block last: TCP and others with pp->num_states <= 1 */
+       else if (af == AF_INET &&
            (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
            (((cp->protocol != IPPROTO_TCP ||
               cp->state == IP_VS_TCP_S_ESTABLISHED) &&
--
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>