Skip to content

Commit fde5b63

Browse files
pingmessage: Fix calculation of checksum
Limit value to be up to two bytes Signed-off-by: Patrick José Pereira <[email protected]>
1 parent 7f8af90 commit fde5b63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

brping/pingmessage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def calculate_checksum(self):
196196
checksum = 0
197197
for byte in self.msg_data[0:PingMessage.headerLength + self.payload_length]:
198198
checksum += byte
199-
return checksum
199+
return checksum & 0xffff
200200

201201
## Update the object checksum value
202202
# @return the object checksum value

0 commit comments

Comments
 (0)