Commit 9751e221 authored by Julien Muchembled's avatar Julien Muchembled

Log unexpected duplicate neighbour, instead of crashing with KeyError

parent 8a1c74d0
......@@ -276,7 +276,20 @@ class Babel(object):
prefix = ip[a:route.plen]
if prefix and not route.refmetric:
neighbours[prefix] = neigh_routes
# XXX: Temporary logging to understand when a KeyError
# happens. Then, we'll problably replace 'remove' by
# 'discard'.
try:
unidentified.remove(address)
except KeyError as e:
logging.warning("address: %s; prefix: %s",
address, prefix)
logging.warning("neighbours: %r", neighbours)
logging.warning("routes: %r", routes)
try:
tm.sendto(tm.cache.registry_prefix, '\7%s' % e)
except AttributeError:
pass
else:
prefix = None
neigh_routes[1][prefix] = route
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment