Skip to content

converting a TCP packet with SAckOK option to a byte sequence fails  #239

@chiplukes

Description

@chiplukes

Here is a simple example that demonstrates this problem:

from scapy3k.all import *

# NOP option
packet = Ether()/IP()/TCP(options=[('NOP',None)])
print(packet[TCP].options) #this works
print(bytes(packet)) #this works

# SAckOK option
packet = Ether()/IP()/TCP(options=[('SAckOK',None)])
print(packet[TCP].options) #this works
print(bytes(packet)) #this breaks

This probably has something to do with the fact that the selective ACK has a length field of 2, but no data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions