On Mon, Aug 12, 2013 at 02:14:52PM -0700, Alex Wang wrote:
> This commit fixes the error introduced by commit 4a1b8f30e59 (bond:
> Stop using tags.). The error is caused by mistakenly returning 'slave'
> where 'slave->aux' should be returned.
> 
> Signed-off-by: Alex Wang <al...@nicira.com>

I am nervous about accessing anything in 'slave' outside the lock.
What do you think of this variant?

Thanks,

Ben.

--8<--------------------------cut here-------------------------->8--

From: Alex Wang <al...@nicira.com>
Date: Mon, 12 Aug 2013 14:14:52 -0700
Subject: [PATCH] band: Fix error in bond_choose_output_slave() function.

This commit fixes the error introduced by commit 4a1b8f30e59 (bond:
Stop using tags.). The error is caused by mistakenly returning 'slave'
where 'slave->aux' should be returned.

Signed-off-by: Alex Wang <al...@nicira.com>
Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 lib/bond.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/bond.c b/lib/bond.c
index a9278db..3834774 100644
--- a/lib/bond.c
+++ b/lib/bond.c
@@ -661,11 +661,14 @@ bond_choose_output_slave(struct bond *bond, const struct 
flow *flow,
                          struct flow_wildcards *wc, uint16_t vlan)
 {
     struct bond_slave *slave;
+    void *aux;
 
     ovs_rwlock_rdlock(&rwlock);
     slave = choose_output_slave(bond, flow, wc, vlan);
+    aux = slave ? slave->aux : NULL;
     ovs_rwlock_unlock(&rwlock);
-    return slave;
+
+    return aux;
 }
 
 /* Rebalancing. */
-- 
1.7.10.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to