diff --git a/scapy/route6.py b/scapy/route6.py index fca4fb92f3eb642d9e5a40266d1635e6af47a377..953339905820363c3ba8014a42162fedaaf0fae4 100644 --- a/scapy/route6.py +++ b/scapy/route6.py @@ -217,8 +217,8 @@ class Route6: warning("No route found for IPv6 destination %s (no default route?)" % dst) return (LOOPBACK_NAME, "::", "::") # XXX Linux specific - pathes.sort() - pathes.reverse() + # Sort with longest prefix first + pathes.sort(reverse=True) best_plen = pathes[0][0] pathes = filter(lambda x: x[0] == best_plen, pathes)