aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs/ip_vs_conn.c
diff options
context:
space:
mode:
authorRumen G. Bogdanovski <rumen@voicecho.com>2007-11-20 00:53:27 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:21 -0500
commitb209639e8a91aaabedf8bf3716710e6d9ae942e3 (patch)
tree53614de391f67fab8fdbaf13d7d05306c17e9c76 /net/ipv4/ipvs/ip_vs_conn.c
parent7a4fbb1fa46e1a84c246e7bcd99bff45935bf114 (diff)
[IPVS]: Create synced connections with their real state
With this patch the synced connections are created with their real state, which can be changed on the next synchronizations if necessary. This way on fail-over all the connections will be treated according to their actual state, causing no scheduling problems (the active and the nonactive connections have different weights in the schedulers). The backwards compatibility is preserved and the existing tools will show the true connection states even on the backup director. Signed-off-by: Rumen G. Bogdanovski <rumen@voicecho.com> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_conn.c')
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 45a642edb93..65f1ba11275 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -393,7 +393,15 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
393 atomic_inc(&dest->refcnt); 393 atomic_inc(&dest->refcnt);
394 394
395 /* Bind with the destination and its corresponding transmitter */ 395 /* Bind with the destination and its corresponding transmitter */
396 cp->flags |= atomic_read(&dest->conn_flags); 396 if ((cp->flags & IP_VS_CONN_F_SYNC) &&
397 (!(cp->flags & IP_VS_CONN_F_TEMPLATE)))
398 /* if the connection is not template and is created
399 * by sync, preserve the activity flag.
400 */
401 cp->flags |= atomic_read(&dest->conn_flags) &
402 (~IP_VS_CONN_F_INACTIVE);
403 else
404 cp->flags |= atomic_read(&dest->conn_flags);
397 cp->dest = dest; 405 cp->dest = dest;
398 406
399 IP_VS_DBG(7, "Bind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " 407 IP_VS_DBG(7, "Bind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d "
@@ -412,7 +420,11 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
412 /* It is a normal connection, so increase the inactive 420 /* It is a normal connection, so increase the inactive
413 connection counter because it is in TCP SYNRECV 421 connection counter because it is in TCP SYNRECV
414 state (inactive) or other protocol inacive state */ 422 state (inactive) or other protocol inacive state */
415 atomic_inc(&dest->inactconns); 423 if ((cp->flags & IP_VS_CONN_F_SYNC) &&
424 (!(cp->flags & IP_VS_CONN_F_INACTIVE)))
425 atomic_inc(&dest->activeconns);
426 else
427 atomic_inc(&dest->inactconns);
416 } else { 428 } else {
417 /* It is a persistent connection/template, so increase 429 /* It is a persistent connection/template, so increase
418 the peristent connection counter */ 430 the peristent connection counter */