aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Schneider <nils@nilsschneider.net>2014-02-04 13:02:38 -0800
committerNils Schneider <nils@nilsschneider.net>2014-02-04 13:02:38 -0800
commitef9d762c939ea3d51d90873dab414f97cf9e91b0 (patch)
treed935da4c786ef7259f990ba4d2c4572d983d3373
parent914836eb9a777d0dbde7bf015b5715dad5fefb15 (diff)
parent613fa425ed4a7a08bc1f19f9b0efa230a74180ef (diff)
Merge pull request #16 from sargon/optimize-nodedb-py
nodedb.py: stop similar mac address check when parts are not equal
-rw-r--r--nodedb.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nodedb.py b/nodedb.py
index b6c2a76..65e4d5e 100644
--- a/nodedb.py
+++ b/nodedb.py
@@ -324,6 +324,9 @@ def is_derived_mac(a, b):
except ValueError:
return False
+ if mac_a[4] != mac_b[4] or mac_a[2] != mac_b[2] or mac_a[1] != mac_b[1]:
+ return False
+
x = list(mac_a)
x[5] += 1
x[5] %= 255