modulo 255 when incrementing macs

This commit is contained in:
Nils Schneider 2012-08-20 23:44:31 +02:00
parent 92b454f1cc
commit a6d7e4e1f3

View file

@ -325,6 +325,7 @@ def is_derived_mac(a, b):
x = mac_a x = mac_a
x[5] += 1 x[5] += 1
x[5] %= 255
if mac_b == x: if mac_b == x:
return True return True
@ -333,18 +334,21 @@ def is_derived_mac(a, b):
return True return True
x[3] += 1 x[3] += 1
x[3] %= 255
if mac_b == x: if mac_b == x:
return True return True
x = mac_a x = mac_a
x[0] |= 2 x[0] |= 2
x[5] += 2 x[5] += 2
x[5] %= 255
if mac_b == x: if mac_b == x:
return True return True
x = mac_a x = mac_a
x[0] |= 2 x[0] |= 2
x[3] += 1 x[3] += 1
x[3] %= 255
if mac_b == x: if mac_b == x:
return True return True