Hi,
We are using
netsnmp5.1. In this we have observed that V3 Inform and Traps are not working.
Below are the details:
We see that for V3 ,
a probe pdu is sent out for getting the engineID of the remote trap destination
for both
INFORM and TRAP.
Whereas this is correct for Inform but for TRAP the sender of trap pdu must use
its own engineID
and NOT send the probe pdu.
TRAP:
We modified
the function, notif_snmp_sess_add_ex(...) in snmp_api.c to fix this. We
replaced the code:
if
(!snmpv3_engineID_probe(slp, in_session))
{
DEBUGMSGTL(("snmp_sess_add", "engine ID probe failed\n"));
snmp_sess_close(slp);
slp = NULL;
DEBUGMSGTL(("snmp_sess_add", "engine ID probe failed\n"));
snmp_sess_close(slp);
slp = NULL;
}
WITH
if
((slp->session->flags & SNMP_FLAGS_DONT_PROBE) ==
SNMP_FLAGS_DONT_PROBE)
{
slp->session->securityEngineID = malloc(MAX_ENGINEID_LENGTH);
slp->session->securityEngineIDLen =
slp->session->securityEngineID = malloc(MAX_ENGINEID_LENGTH);
slp->session->securityEngineIDLen =
snmpv3_get_engineID(slp->session->securityEngineID,MAX_ENGINEID_LENGTH);
} else {
if (!snmpv3_engineID_probe(slp, in_session)) {
DEBUGMSGTL(("snmp_sess_add", "engine ID probe failed\n"));
snmp_sess_close(slp);
slp = NULL;
}
}
} else {
if (!snmpv3_engineID_probe(slp, in_session)) {
DEBUGMSGTL(("snmp_sess_add", "engine ID probe failed\n"));
snmp_sess_close(slp);
slp = NULL;
}
}
Note that above we
maintain a flag SNMP_FLAGS_DONT_PROBE.
With this changes
now it works for TRAP.
For INFORM we
still have a issue.
INFORM:
The inform works
with only NoAuthNoPriv.
In this case with
the probe PDU, we get the user and EngineID of remote trap
destination.
But how do we get
the authKey and PrivKey of the remote user.
Maybe we are missing
something. Please let us know your feedback.
Thanks
Srini
