diff options
author | fenglei <1579628578@qq.com> | 2024-12-14 11:56:01 +0800 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2024-12-16 10:46:52 +0000 |
commit | 7ae20bb3feb9f4a3543b659d1cc9d32c1b4ce95c (patch) | |
tree | ed0186a4988a59563f9d247b0cf0d40864c365eb /src | |
parent | d1177514c4085f7fcdf09ddfcffa5a5d9a2774a8 (diff) |
policer: Add return_dsc for policer_add_command_fn
Type: improvement
add return_desc for except failure
Change-Id: Idcec0f8833fc264f66d2e0a784ece2a62c425263
Signed-off-by: fenglei <1579628578@qq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/policer/policer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/policer/policer.c b/src/vnet/policer/policer.c index 1c575c84ccd..00180d9c993 100644 --- a/src/vnet/policer/policer.c +++ b/src/vnet/policer/policer.c @@ -608,10 +608,13 @@ policer_add_command_fn (vlib_main_t *vm, unformat_input_t *input, policer_index = p[0]; } - if (~0 != policer_index) + if (~0 == policer_index) { - rv = policer_update (vm, policer_index, &c); + error = clib_error_return (0, "Update policer failure"); + goto done; } + + rv = policer_update (vm, policer_index, &c); } else { |