Fix off by one bug in snmp trap v1 generic trap field (#6797)
This commit is contained in:
parent
cae701c54b
commit
a7a639f6a3
|
@ -171,7 +171,7 @@ func makeTrapHandler(s *SnmpTrap) handler {
|
||||||
// translate a v1 trap to v2.
|
// translate a v1 trap to v2.
|
||||||
var trapOid string
|
var trapOid string
|
||||||
|
|
||||||
if packet.GenericTrap > 0 && packet.GenericTrap < 6 {
|
if packet.GenericTrap >= 0 && packet.GenericTrap < 6 {
|
||||||
trapOid = "1.3.6.1.6.3.1.1.5." + strconv.Itoa(packet.GenericTrap+1)
|
trapOid = "1.3.6.1.6.3.1.1.5." + strconv.Itoa(packet.GenericTrap+1)
|
||||||
} else if packet.GenericTrap == 6 {
|
} else if packet.GenericTrap == 6 {
|
||||||
trapOid = packet.Enterprise + ".0." + strconv.Itoa(packet.SpecificTrap)
|
trapOid = packet.Enterprise + ".0." + strconv.Itoa(packet.SpecificTrap)
|
||||||
|
|
Loading…
Reference in New Issue