summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.c
diff options
context:
space:
mode:
authorvarasteh <mahdy.varasteh@gmail.com>2022-01-02 14:20:32 +0330
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 17:39:33 +0000
commit8181727ee518d46ac2f45b769e273431211257a6 (patch)
tree00d5cebc338ab08e41adb23da0fa6dd400fdf0dd /src/vnet/interface.c
parent88d9414e82e2106066047d58c5f0865f3df22ea3 (diff)
interface: more cleaning after set flags is failed in vnet_create_sw_interface
There's a chance that vnet_sw_interface_set_flags_helper() has successfully called some sw interface add callback functions before returning the error. So the sw interface del callbacks should also be called Type: fix Signed-off-by: varasteh <mahdy.varasteh@gmail.com> Change-Id: I2cd7dc6d5b3a5ebfd2c4d1a6be5390083dee6401 Signed-off-by: varasteh <mahdy.varasteh@gmail.com>
Diffstat (limited to 'src/vnet/interface.c')
-rw-r--r--src/vnet/interface.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index dd4399864f7..18ce6b6bc4b 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -655,6 +655,7 @@ vnet_create_sw_interface (vnet_main_t * vnm, vnet_sw_interface_t * template,
/* undo the work done by vnet_create_sw_interface_no_callbacks() */
log_err ("create_sw_interface: set flags failed\n %U",
format_clib_error, error);
+ call_sw_interface_add_del_callbacks (vnm, *sw_if_index, 0);
vnet_sw_interface_t *sw =
pool_elt_at_index (im->sw_interfaces, *sw_if_index);
pool_put (im->sw_interfaces, sw);