diff options
author | 2018-02-14 15:47:19 +0100 | |
---|---|---|
committer | 2018-02-19 10:09:49 +0000 | |
commit | d91d14095b8ac0d3151fd8f6b03277d447029814 (patch) | |
tree | 8a13d06fabde29305353bb4985a70a71253f52bd /src/vpp-api/vom/acl_ethertype.cpp | |
parent | 3a5938223395bb6dc74769d109471f4210217b43 (diff) |
VOM: acl: Some necessary fixes
It:
1. changes ethertype_rule_t to hold actual objects instead of
reference to them.
2. fixes acl_ethertype 'update' function
3. fixes pretty-print of acl-list-update.
4. adds l3-acl update unit test.
Change-Id: Iec72212806e96bd0574b46b563de79f0744cb248
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/acl_ethertype.cpp')
-rw-r--r-- | src/vpp-api/vom/acl_ethertype.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vpp-api/vom/acl_ethertype.cpp b/src/vpp-api/vom/acl_ethertype.cpp index 2f0163398d0..043f0b0e632 100644 --- a/src/vpp-api/vom/acl_ethertype.cpp +++ b/src/vpp-api/vom/acl_ethertype.cpp @@ -70,7 +70,7 @@ singular_db<interface::key_t, acl_ethertype> acl_ethertype::m_db; acl_ethertype::event_handler acl_ethertype::m_evh; acl_ethertype::acl_ethertype(const interface& itf, - acl_ethertype::ethertype_rules_t le) + const acl_ethertype::ethertype_rules_t& le) : m_itf(itf.singular()) , m_le(le) , m_binding(true) @@ -146,15 +146,17 @@ acl_ethertype::to_string() const } void -acl_ethertype::update(const acl_ethertype& old) +acl_ethertype::update(const acl_ethertype& desired) { /* * always update the instance with the latest rules */ - if (!m_binding || old.m_le != m_le) { + if (!m_binding || desired.m_le != m_le) { HW::enqueue( new acl_ethertype_cmds::bind_cmd(m_binding, m_itf->handle(), m_le)); } + + m_le = desired.m_le; } std::shared_ptr<acl_ethertype> |