From: Dan Carpenter Date: Mon, 7 Feb 2011 08:38:55 +0000 (+0300) Subject: IPVS: precedence bug in ip_vs_sync_switch_mode() X-Git-Tag: Ubuntu-snapdragon-4.4.0-1050.54~18618^2~398^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=7c9989a76e62ceca90e5f31f8920fd6b7b8b6525;p=mirror_ubuntu-artful-kernel.git IPVS: precedence bug in ip_vs_sync_switch_mode() '!' has higher precedence than '&'. IP_VS_STATE_MASTER is 0x1 so the original code is equivelent to if (!ipvs->sync_state) ... Signed-off-by: Dan Carpenter Signed-off-by: Hans Schillstrom Signed-off-by: Simon Horman --- diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index 2a2a8363ca16..d1b7298e5894 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -392,7 +392,7 @@ void ip_vs_sync_switch_mode(struct net *net, int mode) { struct netns_ipvs *ipvs = net_ipvs(net); - if (!ipvs->sync_state & IP_VS_STATE_MASTER) + if (!(ipvs->sync_state & IP_VS_STATE_MASTER)) return; if (mode == ipvs->sysctl_sync_ver || !ipvs->sync_buff) return;