Signed-off-by: Andy Zhou <[email protected]>
---
ofproto/ofproto-dpif-xlate.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 93998fb..67b7017 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -850,17 +850,16 @@ static bool
group_is_alive(const struct xlate_ctx *ctx, uint32_t group_id, int depth)
{
struct group_dpif *group;
- bool hit;
- hit = group_dpif_lookup(ctx->xbridge->ofproto, group_id, &group);
- if (!hit) {
- return false;
- }
+ if (group_dpif_lookup(ctx->xbridge->ofproto, group_id, &group)) {
+ struct ofputil_bucket *bucket;
- hit = group_first_live_bucket(ctx, group, depth) != NULL;
+ bucket = group_first_live_bucket(ctx, group, depth);
+ group_dpif_unref(group);
+ return bucket == NULL;
+ }
- group_dpif_unref(group);
- return hit;
+ return false;
}
#define MAX_LIVENESS_RECURSION 128 /* Arbitrary limit */
--
1.9.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev