aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs/ip_vs_conn.c
diff options
context:
space:
mode:
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 45a642edb93b..65f1ba112752 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 */