Adjust payload shift
This commit is contained in:
parent
77b21207b9
commit
b465b366ea
1 changed files with 3 additions and 4 deletions
|
@ -10,7 +10,7 @@ from scapy.all import sniff, get_if_list, Ether, get_if_hwaddr, sendp
|
||||||
from scapy.all import IP, Raw, IPv6, TCP, TCP_client, Ether
|
from scapy.all import IP, Raw, IPv6, TCP, TCP_client, Ether
|
||||||
from scapy.all import sniff
|
from scapy.all import sniff
|
||||||
from scapy.all import Packet, BitField, IntEnumField, ShortField, XShortEnumField, ShortEnumField
|
from scapy.all import Packet, BitField, IntEnumField, ShortField, XShortEnumField, ShortEnumField
|
||||||
from scapy.all import ICMPv6ND_NS
|
from scapy.all import ICMPv6ND_NS, ICMPv6ND_RS
|
||||||
from scapy.data import ETHER_TYPES
|
from scapy.data import ETHER_TYPES
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -243,14 +243,13 @@ class L2Controller(object):
|
||||||
log.debug("CPU packet")
|
log.debug("CPU packet")
|
||||||
cpu_header = CpuHeader(packet.payload)
|
cpu_header = CpuHeader(packet.payload)
|
||||||
|
|
||||||
print("cpu = {} {}".format(cpu_header.__repr__(), len(cpu_header)))
|
log.debug("cpu = {} {}".format(cpu_header.__repr__()))
|
||||||
ether_part = pkg[Ether]
|
ether_part = pkg[Ether]
|
||||||
|
|
||||||
ether_part.type = cpu_header.type
|
ether_part.type = cpu_header.type
|
||||||
|
|
||||||
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[6:])
|
||||||
orig_packet = ether_orig / IPv6(packet.load[5:])
|
|
||||||
log.debug("o={}".format(orig_packet.__repr__()))
|
log.debug("o={}".format(orig_packet.__repr__()))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue