LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [patch] IPVS: precedence bug in ip_vs_sync_switch_mode()

To: "Dan Carpenter" <error27@xxxxxxxxx>
Subject: Re: [patch] IPVS: precedence bug in ip_vs_sync_switch_mode()
Cc: "Wensong Zhang" <wensong@xxxxxxxxxxxx>, "Simon Horman" <horms@xxxxxxxxxxxx>, "Julian Anastasov" <ja@xxxxxx>, hans.schillstrom@xxxxxxxxxxxx, "Patrick McHardy" <kaber@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, kernel-janitors@xxxxxxxxxxxxxxx
From: "Hans Schillstrom" <hans@xxxxxxxxxxxxxxx>
Date: Mon, 7 Feb 2011 10:34:46 +0100 (CET)
>---- Original Message ----
>From: Dan Carpenter <error27@xxxxxxxxx>
>To: "Wensong Zhang" <wensong@xxxxxxxxxxxx>
>Cc: "Simon Horman" <horms@xxxxxxxxxxxx>, "Julian Anastasov" <ja@xxxxxx>, 
>hans.schillstrom@xxxxxxxxxxxx, "Patrick McHardy" <kaber@xxxxxxxxx>, "David S. 
>Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, 
>lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, 
>kernel-janitors@xxxxxxxxxxxxxxx
>Sent: Mon, Feb 7, 2011, 9:39 AM
>Subject: [patch] 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) ...
>
Oops,
Thanks
Hans

>Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
Signed-off-by: Hans Schillstrom <hans.schillstrom@xxxxxxxxxxxx>

>
>diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
>index 2a2a836..d1b7298 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;
>--


--
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>