netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] IPVS: precedence bug in ip_vs_sync_switch_mode()
@ 2011-02-07  8:38 Dan Carpenter
  2011-02-07  9:09 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2011-02-07  8:38 UTC (permalink / raw)
  To: Wensong Zhang
  Cc: Simon Horman, Julian Anastasov, hans.schillstrom, Patrick McHardy,
	David S. Miller, netdev, lvs-devel, netfilter-devel,
	kernel-janitors

'!' 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 <error27@gmail.com>

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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [GIT PULL nf-next-2.6] IPVS
@ 2011-02-07  9:19 Simon Horman
  2011-02-07  9:19 ` [PATCH] IPVS: precedence bug in ip_vs_sync_switch_mode() Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2011-02-07  9:19 UTC (permalink / raw)
  To: netdev, netfilter-devel, netfilter, lvs-devel
  Cc: Julian Anastasov, Hans Schillstrom, Dan Carpenter,
	Patrick McHardy

Hi Patrick,

please consider pulling 
git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git master
to get a precedence bug fix from Dan Carpenter.

 net/netfilter/ipvs/ip_vs_sync.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [patch] IPVS: precedence bug in ip_vs_sync_switch_mode()
@ 2011-02-07  9:34 Hans Schillstrom
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Schillstrom @ 2011-02-07  9:34 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Wensong Zhang, Simon Horman, Julian Anastasov, hans.schillstrom,
	Patrick McHardy, David S. Miller, netdev, lvs-devel,
	netfilter-devel, kernel-janitors

>---- Original Message ----
>From: Dan Carpenter <error27@gmail.com>
>To: "Wensong Zhang" <wensong@linux-vs.org>
>Cc: "Simon Horman" <horms@verge.net.au>, "Julian Anastasov" <ja@ssi.bg>, hans.schillstrom@ericsson.com, "Patrick McHardy" <kaber@trash.net>, "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, kernel-janitors@vger.kernel.org
>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@gmail.com>
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-07  9:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-07  8:38 [patch] IPVS: precedence bug in ip_vs_sync_switch_mode() Dan Carpenter
2011-02-07  9:09 ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2011-02-07  9:19 [GIT PULL nf-next-2.6] IPVS Simon Horman
2011-02-07  9:19 ` [PATCH] IPVS: precedence bug in ip_vs_sync_switch_mode() Simon Horman
2011-02-07  9:34 [patch] " Hans Schillstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).