[dts] [PATCH] framework packet: fix fortville can't receive with default mac

Marvin Liu yong.liu at intel.com
Wed Jul 20 08:02:59 CEST 2016


Fortville will drop packets with 00:00:00:00:00:00 source mac.
Add real source mac will work around this.

Signed-off-by: Marvin Liu <yong.liu at intel.com>

diff --git a/framework/packet.py b/framework/packet.py
index a46fd47..9725055 100755
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -59,6 +59,7 @@ from scapy.sendrecv import sniff
 from scapy.route import *
 from scapy.packet import bind_layers, Raw
 from scapy.sendrecv import sendp
+from scapy.arch import get_if_hwaddr
 
 # load extension layers
 exec_file = os.path.realpath(__file__)
@@ -296,6 +297,8 @@ class scapy(object):
     def send_pkt(self, intf=''):
         self.print_summary()
         if intf != '':
+            # fix fortville can't receive packets with 00:00:00:00:00:00
+            self.pkt.getlayer(0).src = get_if_hwaddr(intf)
             sendp(self.pkt, iface=intf)
 
 
-- 
1.9.3



More information about the dts mailing list