How can i remove a layer from a packet in scapy
lets say we have a packet that consist of the following layers IPv6/IPv6ExtHdrRouting/ICMPv6EchoRequest
i would like to remove the IPv6ExtHdrRouting
layer so we are left with IPv6/ICMPv6EchoRequest
As far as I know, scapy does not have a particular method for stripping layers but scapy's method remove_payload()
can come handy in situations like this. What you can do is.
pkt=IPv6/IPv6ExtHdrRouting/ICMPv6EchoRequest
pkt2=pkt[ICMPv6EchoRequest]
pkt[IPv6].remove_payload()
pkt /=pkt2
Which will leave you with your desired output.