Skip to content

Commit

Permalink
bug:getBulk SnmpPacket can not get right MaxRepetitions value (#413)
Browse files Browse the repository at this point in the history
Signed-off-by: yonwoo9 <yonwoo9@gmail.com>

Signed-off-by: yonwoo9 <yonwoo9@gmail.com>
  • Loading branch information
yonwoo9 committed Oct 5, 2022
1 parent fceb5d3 commit 9a70609
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 @@ -1117,8 +1117,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 9a70609

Please sign in to comment.