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)
  • Loading branch information
Prabhjot Singh Sethi committed Feb 23, 2016
1 parent b679020 commit 99763a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dp-core/vr_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,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 99763a1

Please sign in to comment.