Skip to content

Commit

Permalink
Merge pull request #5 from gosnmp/master
Browse files Browse the repository at this point in the history
bug:getBulk SnmpPacket can not get right MaxRepetitions value (gosnmp#413)
  • Loading branch information
kajtzu committed Oct 13, 2022
2 parents b2db461 + 9a70609 commit b161ba1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,8 @@ func (x *GoSNMP) unmarshalResponse(packet []byte, response *SnmpPacket) error {
return fmt.Errorf("error parsing SNMP packet, packet length %d cursor %d", len(packet), cursor)
}

if maxRepetitions, ok := rawMaxRepetitions.(uint32); ok {
response.MaxRepetitions = (maxRepetitions & 0x7FFFFFFF)
if maxRepetitions, ok := rawMaxRepetitions.(int); ok {
response.MaxRepetitions = uint32(maxRepetitions & 0x7FFFFFFF)
}
} else {
// Parse Error-Status
Expand Down

0 comments on commit b161ba1

Please sign in to comment.