From 73385805174f475fb4815fac28e5a99dece7c725 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Mar 2019 18:40:12 +0100 Subject: [PATCH] ++fix --- p4app/controller.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/p4app/controller.py b/p4app/controller.py index e7af145..5b7aac5 100644 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -248,13 +248,13 @@ class L2Controller(object): ether_part.type = cpu_header.type - bits = 0 + sz = 0 for field in CpuHeader.fields_desc: - bits += field.sz + sz += field.sz - shift_by = (bits/8) -1 + shift_by = (sz*8) -1 - log.debug("Len of cpu= {}, {}, shift={}".format(bits, bits/8, shift_by)) + log.debug("Len of cpu= {}, {}, shift={}".format(sz, shift_by)) ether_orig = Ether(src=packet.src, dst=packet.dst, type=0x86dd) orig_packet = ether_orig / IPv6(packet.load[shift_by:])