aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/api/api.c
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2017-04-07 23:14:17 +0300
committerJohn Lo <loj@cisco.com>2017-04-24 22:33:14 +0000
commitb1352ed0ac39aaa7be7542275d1d43fa64ab28ac (patch)
tree9afdb2ad10cf52bb9a11f67acc555008103072d6 /src/vpp/api/api.c
parent86326daeaa10c5ce4a8aa0b6d97c75a3bbb73493 (diff)
BD:unify bridge domain creation code
Change-Id: I29082e7a0c556069180a157e55b3698cf8cd38c7 Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vpp/api/api.c')
-rw-r--r--src/vpp/api/api.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/vpp/api/api.c b/src/vpp/api/api.c
index 22410fcc..f1b6877f 100644
--- a/src/vpp/api/api.c
+++ b/src/vpp/api/api.c
@@ -410,21 +410,19 @@ static void
bd_main_t *bdm = &bd_main;
vl_api_sw_interface_set_l2_bridge_reply_t *rmp;
int rv = 0;
- u32 rx_sw_if_index = ntohl (mp->rx_sw_if_index);
- u32 bd_id = ntohl (mp->bd_id);
- u32 bd_index;
- u32 bvi = mp->bvi;
- u8 shg = mp->shg;
vlib_main_t *vm = vlib_get_main ();
vnet_main_t *vnm = vnet_get_main ();
VALIDATE_RX_SW_IF_INDEX (mp);
+ u32 rx_sw_if_index = ntohl (mp->rx_sw_if_index);
- bd_index = bd_find_or_add_bd_index (bdm, bd_id);
if (mp->enable)
{
- //VALIDATE_TX_SW_IF_INDEX(mp);
+ u32 bd_id = ntohl (mp->bd_id);
+ u32 bd_index = bd_find_or_add_bd_index (bdm, bd_id);
+ u32 bvi = mp->bvi;
+ u8 shg = mp->shg;
rv = set_int_l2_mode (vm, vnm, MODE_L2_BRIDGE,
rx_sw_if_index, bd_index, bvi, shg, 0);
}