summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-01-15 14:16:45 +0100
committerNeale Ranns <nranns@cisco.com>2018-01-22 22:16:33 +0000
commit1019bafc1444df1e139cae337031fe265669176f (patch)
tree2abf4e4718afbe213ed09f0decab29e417a54b66
parenta370679bd82b3d86ac965e391cc3541973e5682f (diff)
vom: acl: Fix l3 acl handle populate
Change-Id: I5f105a1abb8a28645d6c961ad92f91c23787047f Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
-rw-r--r--src/vpp-api/vom/acl_list.cpp10
-rw-r--r--src/vpp-api/vom/types.cpp6
-rw-r--r--src/vpp-api/vom/types.hpp5
3 files changed, 21 insertions, 0 deletions
diff --git a/src/vpp-api/vom/acl_list.cpp b/src/vpp-api/vom/acl_list.cpp
index 97332788f4c..557de515714 100644
--- a/src/vpp-api/vom/acl_list.cpp
+++ b/src/vpp-api/vom/acl_list.cpp
@@ -92,6 +92,14 @@ l3_list::event_handler::handle_populate(const client_db::key_t& key)
payload.r[ii].dst_ip_prefix_len);
l3_rule rule(ii, action_t::from_int(payload.r[ii].is_permit), src, dst);
+ rule.set_proto(payload.r[ii].proto);
+ rule.set_src_from_port(payload.r[ii].srcport_or_icmptype_first);
+ rule.set_src_to_port(payload.r[ii].srcport_or_icmptype_last);
+ rule.set_dst_from_port(payload.r[ii].dstport_or_icmpcode_first);
+ rule.set_dst_to_port(payload.r[ii].dstport_or_icmpcode_last);
+ rule.set_tcp_flags_mask(payload.r[ii].tcp_flags_mask);
+ rule.set_tcp_flags_value(payload.r[ii].tcp_flags_value);
+
acl.insert(rule);
}
VOM_LOG(log_level_t::DEBUG) << "dump: " << acl.to_string();
@@ -169,6 +177,7 @@ void
l3_list::replay(void)
{
if (m_hdl) {
+ m_hdl.data().reset();
HW::enqueue(new list_cmds::l3_update_cmd(m_hdl, m_key, m_rules));
}
}
@@ -177,6 +186,7 @@ void
l2_list::replay(void)
{
if (m_hdl) {
+ m_hdl.data().reset();
HW::enqueue(new list_cmds::l2_update_cmd(m_hdl, m_key, m_rules));
}
}
diff --git a/src/vpp-api/vom/types.cpp b/src/vpp-api/vom/types.cpp
index 9df53146948..4f8884615e2 100644
--- a/src/vpp-api/vom/types.cpp
+++ b/src/vpp-api/vom/types.cpp
@@ -94,6 +94,12 @@ handle_t::value() const
return (m_value);
}
+void
+handle_t::reset()
+{
+ m_value = ~0;
+}
+
std::ostream&
operator<<(std::ostream& os, const handle_t& h)
{
diff --git a/src/vpp-api/vom/types.hpp b/src/vpp-api/vom/types.hpp
index 61a25e71cb8..4deb6c489a6 100644
--- a/src/vpp-api/vom/types.hpp
+++ b/src/vpp-api/vom/types.hpp
@@ -203,6 +203,11 @@ struct handle_t
*/
uint32_t value() const;
+ /**
+ * reset the value of the handle to ~0
+ */
+ void reset();
+
private:
/**
* VPP's handle value