Convert snmp_trap_test.go to table test (#6803)

Add a test for v1 generic trap.  Add missing leading period in v1 generic trap oid.
This commit is contained in:
reimda
2019-12-17 15:12:42 -07:00
committed by GitHub
parent 2beb79969a
commit 99279e6461
2 changed files with 268 additions and 263 deletions

View File

@@ -172,7 +172,7 @@ func makeTrapHandler(s *SnmpTrap) handler {
var trapOid string
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 {
trapOid = packet.Enterprise + ".0." + strconv.Itoa(packet.SpecificTrap)
}