Merge into master from pull request #167:
dataplane: support PyPI version of pypcap (https://github.com/floodlight/oftest/pull/167)
diff --git a/src/python/oftest/dataplane.py b/src/python/oftest/dataplane.py
index 740e6aa..8cda932 100644
--- a/src/python/oftest/dataplane.py
+++ b/src/python/oftest/dataplane.py
@@ -129,7 +129,10 @@
return (pkt[:], timestamp)
def send(self, packet):
- return self.pcap.inject(packet, len(packet))
+ if hasattr(self.pcap, "inject"):
+ return self.pcap.inject(packet, len(packet))
+ else:
+ return self.pcap.sendpacket(packet)
def down(self):
pass