From c935fa152a2d4f36ad755845fba77da1435ab989 Mon Sep 17 00:00:00 2001 From: Otthorn Date: Thu, 15 Apr 2021 00:35:04 +0200 Subject: [PATCH] :bug: Fix serial number arithmetics --- lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib.py b/lib.py index 091006a..031019a 100644 --- a/lib.py +++ b/lib.py @@ -87,10 +87,11 @@ def update_serial(serial, serial_bits=32): """Update serial number According to RFC 1982 and Knot implementation. - SERIAL_BITS = 32 by default. + SERIAL_BITS = 32 by default, which means the serial number counter can + range from 0 to 2^32 - 1. """ - serial = serial + 1 % 2**32 + serial = (serial + 1) % 2**serial_bits return serial