From 02ebc34fdac5a6f6d932a169c8afad0feb7c509b Mon Sep 17 00:00:00 2001
From: Guillaume Valadon <guillaume@valadon.net>
Date: Tue, 23 Jul 2013 14:03:07 +0200
Subject: [PATCH] Issue #186: Scapy backtraces when sending a packet with a
 route6 entry that has no srcaddr

---
 scapy/route6.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scapy/route6.py b/scapy/route6.py
index 51116aaf..67b5328d 100644
--- a/scapy/route6.py
+++ b/scapy/route6.py
@@ -233,6 +233,10 @@ class Route6:
             if srcaddr is not None:
                 res.append((p[0], (tmp[0], srcaddr, tmp[2])))
 
+        if res == []:
+            warning("Found a route for IPv6 destination '%s', but no possible source address." % dst)
+            return (LOOPBACK_NAME, "::", "::") # XXX Linux specific
+
         # Symptom  : 2 routes with same weight (our weight is plen)
         # Solution : 
         #  - dst is unicast global. Check if it is 6to4 and we have a source 
-- 
GitLab