Skip to content

Commit

Permalink
Vrouter to return error for invalid flow op
Browse files Browse the repository at this point in the history
If a flow operation is requested for an index which
is not active, vrouter should return an ENOENT error
for such operation

Closes-Bug: 1548678
Change-Id: I42bbd58f41a868b1ce630046ae40e911df0d9491
(cherry picked from commit 1cf3761)
(cherry picked from commit 99763a1)
  • Loading branch information
Prabhjot Singh Sethi authored and naveen-n committed Mar 7, 2016
1 parent 737a135 commit c145211
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dp-core/vr_flow.c
Expand Up @@ -1557,6 +1557,15 @@ vr_flow_set_req_is_invalid(struct vrouter *router, vr_flow_req *req,
goto invalid_req;
}
}
} else {
/*
* flow set request received with an index which is
* not active anymore, return ENOENT error
*/
if ((req->fr_flags & VR_FLOW_FLAG_ACTIVE) && !(req->fr_index < 0)) {
error = -ENOENT;
goto invalid_req;
}
}

if (req->fr_flags & VR_FLOW_FLAG_VRFT) {
Expand Down

0 comments on commit c145211

Please sign in to comment.