summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-04-25 15:58:05 +0200
committerMohsin Kazmi <sykazmi@cisco.com>2018-05-28 11:14:41 +0200
commita50a14c5577e82866b05f325e359c86ba7145730 (patch)
tree66dd4d9fe7d2692b76a78472260d85eff34de75d /src/vnet/interface.c
parent4fed5b1b34b346f25feef34c590b4dd428343756 (diff)
itf: Fix admin up down for AF_PACKET and vhost-user
Change-Id: I84327197d59c72d0d046dd2cb4071bf74af6fc28 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
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)
{