From c14521119e70dbf8cc93d3de29d354bd5c8a7d24 Mon Sep 17 00:00:00 2001 From: Prabhjot Singh Sethi Date: Tue, 23 Feb 2016 14:04:54 +0530 Subject: [PATCH] Vrouter to return error for invalid flow op 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 1cf37614abb25bca4a93e8101f1af68a77a59552) (cherry picked from commit 99763a1fa5509e4fe2384ee36bdb300bc26f1352) --- dp-core/vr_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dp-core/vr_flow.c b/dp-core/vr_flow.c index 9846fe0c9..3cd40e5dd 100644 --- a/dp-core/vr_flow.c +++ b/dp-core/vr_flow.c @@ -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) {