summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/packet/packet.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/ryu/lib/packet/packet.py b/ryu/lib/packet/packet.py
index 2ef08c15..f5fd82df 100644
--- a/ryu/lib/packet/packet.py
+++ b/ryu/lib/packet/packet.py
@@ -31,15 +31,14 @@ class Packet(object):
*data* should be omitted when encoding a packet.
"""
- def __init__(self, data=None):
+ def __init__(self, data=None, parse_cls=ethernet.ethernet):
super(Packet, self).__init__()
self.data = data
self.protocols = []
self.protocol_idx = 0
self.parsed_bytes = 0
if self.data:
- # Do we need to handle non ethernet?
- self._parser(ethernet.ethernet)
+ self._parser(parse_cls)
def _parser(self, cls):
while cls: