diff options
author | Chenmin Sun <chenmin.sun@intel.com> | 2019-11-22 05:33:40 +0800 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-08-12 07:43:03 +0000 |
commit | cb3edd53e8ba606245c9965a374f7719d4367a60 (patch) | |
tree | 7feeb5b3b1cb5820f497c7b10031c29b61753f66 /src/vnet | |
parent | cd3a7c96464aca67ab45117db740d56b091666ff (diff) |
flow: fix several crash issues
Type: fix
This patch fixes crash issues(marked in brackets) in the below test cases
test flow enable index 0 1/1 -> [crash]
test flow disable index 0 1/1 -> [crash]
test flow add src-ip 192.168.8.8 proto udp redirect-to-queue 8
test flow enable index 0 1/1
test flow disable index 0 1/1 - [crash]
test flow add src-ip 192.168.8.8 proto udp redirect-to-queue 8
test flow enable index 0 1/1
test flow enable index 0 1/2
test flow del index 0 -> [crash]
Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: I84bc6faa3d93a2cab4c82e8a876a8b1067257b62
(cherry picked from commit be2ad0b4743ed8a3875a5b6039c10c66eb07614c)
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/flow/flow.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/flow/flow.c b/src/vnet/flow/flow.c index 4d867fee365..9b6a376af3e 100644 --- a/src/vnet/flow/flow.c +++ b/src/vnet/flow/flow.c @@ -96,6 +96,9 @@ vnet_flow_enable (vnet_main_t * vnm, u32 flow_index, u32 hw_if_index) uword private_data; int rv; + if (f == 0) + return VNET_FLOW_ERROR_NO_SUCH_ENTRY; + if (!vnet_hw_interface_is_valid (vnm, hw_if_index)) return VNET_FLOW_ERROR_NO_SUCH_INTERFACE; @@ -137,6 +140,9 @@ vnet_flow_disable (vnet_main_t * vnm, u32 flow_index, u32 hw_if_index) uword *p; int rv; + if (f == 0) + return VNET_FLOW_ERROR_NO_SUCH_ENTRY; + if (!vnet_hw_interface_is_valid (vnm, hw_if_index)) return VNET_FLOW_ERROR_NO_SUCH_INTERFACE; |