From cd743ff46cd3fd4fd8af86b2c7114d8ce41bc46e Mon Sep 17 00:00:00 2001 From: Andreas Baldeau Date: Fri, 31 Jan 2014 21:50:09 +0100 Subject: [PATCH 1/2] Fixes client mac obfuscation. Node to node links stay untouched now. --- nodedb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nodedb.py b/nodedb.py index 9dd9849..37c6e09 100644 --- a/nodedb.py +++ b/nodedb.py @@ -232,6 +232,12 @@ class NodeDB: try: node_source = self.maybe_node_by_fuzzy_mac(ids) node_target = self.maybe_node_by_id(idt) + + if not node_source.flags['client'] and not node_target.flags['client']: + # if none of the nodes associated with this link are clients, + # we do not want to obscure + continue + if ids in clientIds and idt in clientIds: # This is for corner cases, when a client # is linked to another client. From ddf7e4f8dbd7ef00a94ce517ada89c46bd552a38 Mon Sep 17 00:00:00 2001 From: Andreas Baldeau Date: Fri, 31 Jan 2014 22:14:28 +0100 Subject: [PATCH 2/2] Fixed variable name and catches only KeyErrors to not hide other errors. --- nodedb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodedb.py b/nodedb.py index 37c6e09..6e77717 100644 --- a/nodedb.py +++ b/nodedb.py @@ -229,6 +229,7 @@ class NodeDB: for link in self._links: ids = link.source.interface idt = link.target.interface + try: node_source = self.maybe_node_by_fuzzy_mac(ids) node_target = self.maybe_node_by_id(idt) @@ -242,7 +243,7 @@ class NodeDB: # This is for corner cases, when a client # is linked to another client. clientIds[ids] = str(globalIdCounter) - id1 = str(globalIdCounter) + ids = str(globalIdCounter) globalIdCounter += 1 clientIds[idt] = str(globalIdCounter) @@ -267,7 +268,7 @@ class NodeDB: link.id = ids + "-" + idt - except: + except KeyError: pass # extends node id by incremented node counter