summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-03-16 03:22:39 -0700
committerNeale Ranns <nranns@cisco.com>2018-03-18 03:16:49 -0700
commit2ae2bc5380845d1480ec385749b7e8515e3b2185 (patch)
tree417ed52791d5735b3fbf55bfc2c105f32e66b860 /src/vnet/interface_api.c
parent33d162909f9d87507d85d494527d121e081f4a58 (diff)
Remove unnumbered configuration on interface delete
Change-Id: Iae5532c3d53e208831f3b2782242d9e59d367087 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index fc7af1be463..b22cadd871e 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -582,7 +582,6 @@ static void vl_api_sw_interface_set_unnumbered_t_handler
vnet_main_t *vnm = vnet_get_main ();
u32 sw_if_index = ntohl (mp->sw_if_index);
u32 unnumbered_sw_if_index = ntohl (mp->unnumbered_sw_if_index);
- u32 was_unnum;
/*
* The API message field names are backwards from
@@ -602,42 +601,8 @@ static void vl_api_sw_interface_set_unnumbered_t_handler
goto done;
}
- vnet_sw_interface_t *si =
- vnet_get_sw_interface (vnm, unnumbered_sw_if_index);
- was_unnum = (si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED);
-
- if (mp->is_add)
- {
- si->flags |= VNET_SW_INTERFACE_FLAG_UNNUMBERED;
- si->unnumbered_sw_if_index = sw_if_index;
-
- ip4_main.lookup_main.if_address_pool_index_by_sw_if_index
- [unnumbered_sw_if_index] =
- ip4_main.
- lookup_main.if_address_pool_index_by_sw_if_index[sw_if_index];
- ip6_main.
- lookup_main.if_address_pool_index_by_sw_if_index
- [unnumbered_sw_if_index] =
- ip6_main.
- lookup_main.if_address_pool_index_by_sw_if_index[sw_if_index];
- }
- else
- {
- si->flags &= ~(VNET_SW_INTERFACE_FLAG_UNNUMBERED);
- si->unnumbered_sw_if_index = (u32) ~ 0;
-
- ip4_main.lookup_main.if_address_pool_index_by_sw_if_index
- [unnumbered_sw_if_index] = ~0;
- ip6_main.lookup_main.if_address_pool_index_by_sw_if_index
- [unnumbered_sw_if_index] = ~0;
- }
-
- if (was_unnum != (si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED))
- {
- ip4_sw_interface_enable_disable (unnumbered_sw_if_index, mp->is_add);
- ip6_sw_interface_enable_disable (unnumbered_sw_if_index, mp->is_add);
- }
-
+ vnet_sw_interface_update_unnumbered (unnumbered_sw_if_index,
+ sw_if_index, mp->is_add);
done:
REPLY_MACRO (VL_API_SW_INTERFACE_SET_UNNUMBERED_REPLY);
}