Skip to content

Commit

Permalink
ofproto-dpif-xlate: Simplify group_is_alive
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed May 23, 2014
1 parent d7417fc commit dc25893
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ofproto/ofproto-dpif-xlate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit dc25893

Please sign in to comment.