Skip to content
Snippets Groups Projects
Commit 93db349b authored by Guillaume Valadon's avatar Guillaume Valadon
Browse files

Merge pull request #45 from p-l-/fix-macsrc

Use conf.iface MAC address by default when Scapy cannot find the route
parents 997ed641 7d283bfb
No related branches found
No related tags found
No related merge requests found
...@@ -103,7 +103,9 @@ class SourceMACField(MACField): ...@@ -103,7 +103,9 @@ class SourceMACField(MACField):
MACField.__init__(self, name, None) MACField.__init__(self, name, None)
def i2h(self, pkt, x): def i2h(self, pkt, x):
if x is None: if x is None:
iff,a,gw = pkt.payload.route() iff, a, gw = pkt.payload.route()
if iff is None:
iff = conf.iface
if iff: if iff:
try: try:
x = get_if_hwaddr(iff) x = get_if_hwaddr(iff)
......
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