aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface.c')
-rw-r--r--src/vnet/interface.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index 36793f1177e..d85d864839e 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -485,10 +485,13 @@ vnet_sw_interface_set_flags_helper (vnet_main_t * vnm, u32 sw_if_index,
error = call_elf_section_interface_callbacks
(vnm, sw_if_index, flags,
vnm->sw_interface_admin_up_down_functions);
- si->flags = old_flags;
if (error)
- goto done;
+ {
+ /* restore flags on error */
+ si->flags = old_flags;
+ goto done;
+ }
if (si->type == VNET_SW_INTERFACE_TYPE_HARDWARE)
{