aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip_vs.h11
-rw-r--r--net/netfilter/ipvs/ip_vs_sync.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 253736db476b..687ef18227cd 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -911,6 +911,7 @@ struct netns_ipvs {
911 911
912#define DEFAULT_SYNC_THRESHOLD 3 912#define DEFAULT_SYNC_THRESHOLD 3
913#define DEFAULT_SYNC_PERIOD 50 913#define DEFAULT_SYNC_PERIOD 50
914#define DEFAULT_SYNC_VER 1
914 915
915#ifdef CONFIG_SYSCTL 916#ifdef CONFIG_SYSCTL
916 917
@@ -924,6 +925,11 @@ static inline int sysctl_sync_period(struct netns_ipvs *ipvs)
924 return ipvs->sysctl_sync_threshold[1]; 925 return ipvs->sysctl_sync_threshold[1];
925} 926}
926 927
928static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
929{
930 return ipvs->sysctl_sync_ver;
931}
932
927#else 933#else
928 934
929static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) 935static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs)
@@ -936,6 +942,11 @@ static inline int sysctl_sync_period(struct netns_ipvs *ipvs)
936 return DEFAULT_SYNC_PERIOD; 942 return DEFAULT_SYNC_PERIOD;
937} 943}
938 944
945static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
946{
947 return DEFAULT_SYNC_VER;
948}
949
939#endif 950#endif
940 951
941/* 952/*
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index e84987fa1bf8..3e7961e85e9c 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -394,7 +394,7 @@ void ip_vs_sync_switch_mode(struct net *net, int mode)
394 394
395 if (!(ipvs->sync_state & IP_VS_STATE_MASTER)) 395 if (!(ipvs->sync_state & IP_VS_STATE_MASTER))
396 return; 396 return;
397 if (mode == ipvs->sysctl_sync_ver || !ipvs->sync_buff) 397 if (mode == sysctl_sync_ver(ipvs) || !ipvs->sync_buff)
398 return; 398 return;
399 399
400 spin_lock_bh(&ipvs->sync_buff_lock); 400 spin_lock_bh(&ipvs->sync_buff_lock);
@@ -521,7 +521,7 @@ void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp)
521 unsigned int len, pe_name_len, pad; 521 unsigned int len, pe_name_len, pad;
522 522
523 /* Handle old version of the protocol */ 523 /* Handle old version of the protocol */
524 if (ipvs->sysctl_sync_ver == 0) { 524 if (sysctl_sync_ver(ipvs) == 0) {
525 ip_vs_sync_conn_v0(net, cp); 525 ip_vs_sync_conn_v0(net, cp);
526 return; 526 return;
527 } 527 }