Node sheduled for status for conf poll after tunnel bind. Fixes #NX-1313
authorEriks Jenkevics <eriks@netxms.org>
Tue, 3 Oct 2017 09:00:47 +0000 (12:00 +0300)
committerEriks Jenkevics <eriks@netxms.org>
Tue, 3 Oct 2017 09:38:03 +0000 (12:38 +0300)
include/nxcldefs.h
src/server/core/tunnel.cpp
src/server/include/nms_objects.h

index e4cb81f..bf15548 100644 (file)
 #define NDF_QUEUED_FOR_DISCOVERY_POLL  0x00020000
 #define NDF_QUEUED_FOR_ROUTE_POLL      0x00040000
 #define NDF_RECHECK_CAPABILITIES       0x00080000
+#define NDF_NEW_TUNNEL_BIND            0x00100000
 
 /**
  *
index d14905e..5c7223f 100644 (file)
@@ -505,6 +505,7 @@ UINT32 AgentTunnel::bind(UINT32 nodeId)
    if (rcc == ERR_SUCCESS)
    {
       debugPrintf(4, _T("Bind successful, resetting tunnel"));
+      node->setNewTunnelBindFlag();
       msg.setCode(CMD_RESET_TUNNEL);
       msg.setId(InterlockedIncrement(&m_requestId));
       sendMessage(&msg);
@@ -1010,6 +1011,12 @@ retry:
                   if (tunnelGuid.equals(node->getTunnelId()))
                   {
                      nxlog_debug(4, _T("SetupTunnel(%s): Tunnel attached to node %s [%d]"), (const TCHAR *)request->addr.toString(), node->getName(), node->getId());
+                     if (node->getRuntimeFlags() & NDF_NEW_TUNNEL_BIND)
+                     {
+                        node->removeNewTunnelBindFlag();
+                        node->setRecheckCapsFlag();
+                        node->forceConfigurationPoll();
+                     }
                      nodeId = node->getId();
                      zoneUIN = node->getZoneUIN();
                   }
index bb0e66e..68d5fd2 100644 (file)
@@ -1863,6 +1863,8 @@ public:
    time_t getLastAgentCommTime() const { return m_lastAgentCommTime; }
    const TCHAR *getPrimaryName() const { return m_primaryName; }
    const uuid& getTunnelId() const { return m_tunnelId; }
+   void setNewTunnelBindFlag() { m_runtimeFlags |= NDF_NEW_TUNNEL_BIND; }
+   void removeNewTunnelBindFlag() { m_runtimeFlags &= ~NDF_NEW_TUNNEL_BIND; }
 
    bool isDown() { return (m_state & DCSF_UNREACHABLE) ? true : false; }
        time_t getDownTime() const { return m_downSince; }