VOM: vxlan_tunnel equals operator 26/17326/2
authorNeale Ranns <nranns@cisco.com>
Tue, 5 Feb 2019 15:17:11 +0000 (07:17 -0800)
committerNeale Ranns <nranns@cisco.com>
Tue, 5 Feb 2019 16:44:49 +0000 (16:44 +0000)
Change-Id: I0e524b5d7c02a099b6ce84e6a0c116b19200879d
Signed-off-by: Neale Ranns <nranns@cisco.com>
extras/vom/vom/vxlan_tunnel.cpp
extras/vom/vom/vxlan_tunnel.hpp

index ca07901..faf49bd 100644 (file)
@@ -116,6 +116,12 @@ vxlan_tunnel::vxlan_tunnel(const vxlan_tunnel& o)
 {
 }
 
+bool
+vxlan_tunnel::operator==(const vxlan_tunnel& other) const
+{
+  return ((m_tep == other.m_tep) && (m_mode == other.m_mode));
+}
+
 const handle_t&
 vxlan_tunnel::handle() const
 {
@@ -177,7 +183,7 @@ vxlan_tunnel::update(const vxlan_tunnel& desired)
   /*
    * the desired state is always that the interface should be created
    */
-  if (!m_hdl) {
+  if (rc_t::OK != m_hdl.rc()) {
     if (mode_t::STANDARD == m_mode)
       HW::enqueue(new vxlan_tunnel_cmds::create_cmd(
         m_hdl, name(), m_tep,
index 63124e7..c085ba0 100644 (file)
@@ -113,6 +113,11 @@ public:
    */
   vxlan_tunnel(const vxlan_tunnel& o);
 
+  /**
+   * comparison operator
+   */
+  bool operator==(const vxlan_tunnel& vx) const;
+
   /**
    * Return the matching 'singular instance'
    */