Skip to content
Snippets Groups Projects
Commit 1ce93436 authored by Dirk Loss's avatar Dirk Loss
Browse files

Catch dnet OSError exception during routing table analysis

dnet throws an "OSError: No error" exception when we want to get
the outgoing interface and the interface has no IP address.
This uncaught exception made Scapy exit.
parent 4ccc82a5
No related branches found
No related tags found
No related merge requests found
...@@ -246,7 +246,11 @@ def read_routes(): ...@@ -246,7 +246,11 @@ def read_routes():
gw = match.group(3) gw = match.group(3)
netif = match.group(4) netif = match.group(4)
metric = match.group(5) metric = match.group(5)
intf = pcapdnet.dnet.intf().get_dst(pcapdnet.dnet.addr(type=2, addrtxt=dest)) try:
intf = pcapdnet.dnet.intf().get_dst(pcapdnet.dnet.addr(type=2, addrtxt=dest))
except OSError:
log_loading.warning("Building Scapy's routing table: Couldn't get outgoing interface for destination %s" % dest)
continue
if not intf.has_key("addr"): if not intf.has_key("addr"):
break break
addr = str(intf["addr"]) addr = str(intf["addr"])
......
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