Skip to content

Commit

Permalink
engine ID discovery uses different source port
Browse files Browse the repository at this point in the history
  • Loading branch information
verrio committed Sep 10, 2017
1 parent efa3a62 commit 30268b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void Agent::Init(void)
connect(&timer, SIGNAL(timeout()), this, SLOT(TimerExpired()));

// get the Boot counter (you may use any own method for this)
char *engineId = (char*)"snmpb_engine";
char *engineId = (char*)"snmp-client";
unsigned int snmpEngineBoots = 0;

status = getBootCounter(s->GetBootCounterConfigFile().toUtf8().data(),
Expand Down Expand Up @@ -802,7 +802,7 @@ void Agent::AsyncCallbackTrap(int reason, Pdu &pdu, SnmpTarget &target)
if (pdu.get_type() == sNMP_PDU_INFORM)
{
// Copy the PDU object to feed back in the response
Pdu ipdu = pdu;
Pdu ipdu(pdu);
Vb t(Oid("1.3.6.1.2.1.1.3.0"));
t.set_value(ts);
Vb d(Oid("1.3.6.1.6.3.1.1.4.1.0"));
Expand Down
10 changes: 2 additions & 8 deletions src/snmp++/mp_v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,14 +881,8 @@ int v3MP::send_report(unsigned char* scopedPDU, int scopedPDULength,
debugprintf(2, "v3MP::send_report: error serializing message (mpSnmpBuild returns: %i).", status);
return SNMPv3_MP_ERROR;
}
SnmpSocket send_fd = INVALID_SOCKET;
if (pdu_type == sNMP_PDU_INFORM)
{
debugprintf(4, "Received a snmpInform pdu.");
if (snmp_session->get_eventListHolder()->notifyEventList())
send_fd = snmp_session->get_eventListHolder()->notifyEventList()->get_notify_fd();
}

SnmpSocket send_fd =
snmp_session->get_eventListHolder()->notifyEventList()->get_notify_fd();
status = snmp_session->send_raw_data(sendbuffer.get_ptr(),
(size_t)sendbufferlen,// pdu to send
destination, // target address
Expand Down

0 comments on commit 30268b4

Please sign in to comment.