From b465b366eabf4c204f6eef96dc088ce7180a6f88 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Mar 2019 18:31:20 +0100 Subject: [PATCH] Adjust payload shift --- p4app/controller.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/p4app/controller.py b/p4app/controller.py index 2064b80..784fe7b 100644 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -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 sniff 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 import sys @@ -243,14 +243,13 @@ class L2Controller(object): log.debug("CPU packet") 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.type = cpu_header.type ether_orig = Ether(src=packet.src, dst=packet.dst, type=0x86dd) - - orig_packet = ether_orig / IPv6(packet.load[5:]) + orig_packet = ether_orig / IPv6(packet.load[6:]) log.debug("o={}".format(orig_packet.__repr__()))