summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/interface.cpp
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-11-17 05:08:55 -0800
committerNeale Ranns <nranns@cisco.com>2017-11-17 14:39:53 +0000
commit8ac4ce8547d84c2d581f572b4f51fd34dbf1b01f (patch)
tree98e93c8cd57b551dd229ecaca9d8c2bcf86025dc /src/vpp-api/vom/interface.cpp
parentddecfb3d9f5960b69d964f9e870a6ded78a52f1f (diff)
VOM fixes and logger improvements
Change-Id: I5e3fa5e098a8ea26dbc3d3a1dc064e3507e33d8e Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface.cpp')
-rw-r--r--src/vpp-api/vom/interface.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/vpp-api/vom/interface.cpp b/src/vpp-api/vom/interface.cpp
index 1c90a31bb32..8f1023d2273 100644
--- a/src/vpp-api/vom/interface.cpp
+++ b/src/vpp-api/vom/interface.cpp
@@ -54,10 +54,10 @@ interface::interface(const handle_t& handle,
const std::string& name,
interface::type_t type,
interface::admin_state_t state)
- : m_hdl(handle)
+ : m_hdl(handle, rc_t::OK)
, m_name(name)
, m_type(type)
- , m_state(state)
+ , m_state(state, rc_t::OK)
, m_table_id(route::DEFAULT_TABLE)
, m_l2_address(l2_address)
, m_oper(oper_state_t::DOWN)
@@ -278,9 +278,19 @@ interface::update(const interface& desired)
if (rc_t::OK != m_hdl.rc()) {
std::queue<cmd*> cmds;
HW::enqueue(mk_create_cmd(cmds));
+ /*
+ * interface create now, so we can barf early if it fails
+ */
+ HW::write();
}
/*
+ * If the interface is not created do other commands should be issued
+ */
+ if (rc_t::OK != m_hdl.rc())
+ return;
+
+ /*
* change the interface state to that which is deisred
*/
if (m_state.update(desired.m_state)) {