++fix
This commit is contained in:
parent
9771591a9d
commit
7338580517
1 changed files with 4 additions and 4 deletions
|
@ -248,13 +248,13 @@ class L2Controller(object):
|
||||||
|
|
||||||
ether_part.type = cpu_header.type
|
ether_part.type = cpu_header.type
|
||||||
|
|
||||||
bits = 0
|
sz = 0
|
||||||
for field in CpuHeader.fields_desc:
|
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)
|
ether_orig = Ether(src=packet.src, dst=packet.dst, type=0x86dd)
|
||||||
orig_packet = ether_orig / IPv6(packet.load[shift_by:])
|
orig_packet = ether_orig / IPv6(packet.load[shift_by:])
|
||||||
|
|
Loading…
Reference in a new issue