Skip to content
Snippets Groups Projects
Commit c9440698 authored by Roman Haefeli's avatar Roman Haefeli
Browse files

dont allow self-connection

parent 6d889df8
No related branches found
No related tags found
No related merge requests found
......@@ -65,10 +65,11 @@ def addlink():
def addtoken(token, addr):
if token in tokenlookup:
tokenlookup[token].append(addr)
linklookup[tokenlookup[token][0]] = tokenlookup[token][1]
linklookup[tokenlookup[token][1]] = tokenlookup[token][0]
del tokenlookup[token]
if addr not in tokenlookup[token]:
tokenlookup[token].append(addr)
linklookup[tokenlookup[token][0]] = tokenlookup[token][1]
linklookup[tokenlookup[token][1]] = tokenlookup[token][0]
del tokenlookup[token]
else:
tokenlookup[token] = [addr]
......@@ -122,7 +123,7 @@ while True:
try:
addtoken(token[1], srcaddr)
except:
print "error with parsing token"
pass
# forward data according to lookup table
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment