diff options
author | Nils Schneider <nils@nilsschneider.net> | 2014-02-01 19:27:29 -0800 |
---|---|---|
committer | Nils Schneider <nils@nilsschneider.net> | 2014-02-01 19:27:29 -0800 |
commit | bd19e5f18ccefff3eee9fabe656956d3ece9adda (patch) | |
tree | f6536fcd3c5dc07d3343ddbb72948f64eb929af6 | |
parent | 634b37fee24213ff9d010708ecac197a0b28d003 (diff) | |
parent | ddf7e4f8dbd7ef00a94ce517ada89c46bd552a38 (diff) |
Merge pull request #15 from freifunkhamburg/obfuscation-fixes
Obfuscation fixes
-rw-r--r-- | nodedb.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -229,14 +229,21 @@ 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) + + 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. clientIds[ids] = str(globalIdCounter) - id1 = str(globalIdCounter) + ids = str(globalIdCounter) globalIdCounter += 1 clientIds[idt] = str(globalIdCounter) @@ -261,7 +268,7 @@ class NodeDB: link.id = ids + "-" + idt - except: + except KeyError: pass # extends node id by incremented node counter |