Brief description
Since #5095 ("opc_da: fix STDOBJREF IPID and Fack selack field types"), building an OpcDaFack with selack=None
succeeds and serializes the entry as zero bytes. Before #5095 the build failed with
While building field 'selack': cannot convert 'NoneType' object to bytes.
This is an edge case and may well be acceptable; reporting it in case the silent zero value is not intended, since
selack is a list of integers and None is not a valid entry.
Scapy version
master at c5e9a5b (2026-09-26)
Python version
3.10
Operating system
Linux (Docker)
Additional environment information
No response
How to reproduce
from scapy.contrib.opc_da import OpcDaFack
from scapy.all import raw
pkt = OpcDaFack(selack=None)
print(pkt.selack, pkt.selackLen) # [None] 0
print(raw(pkt).hex())
Actual result
[None] 0
000000000000000000000000000000000000000000
selackLen stays 0, but the packet is 4 bytes longer than raw(OpcDaFack()) (17 bytes): the None entry is written as a zero integer, so the length field and the list disagree.
Expected result
An error for the invalid None entry, as before, or at least a length field consistent with the list.
Related resources
#5095 (cc @mmadersbacher). Found by differential testing of recent pull requests and reproduced by hand on current master.
Brief description
Since #5095 ("opc_da: fix STDOBJREF IPID and Fack selack field types"), building an
OpcDaFackwithselack=Nonesucceeds and serializes the entry as zero bytes. Before #5095 the build failed with
While building field 'selack': cannot convert 'NoneType' object to bytes.This is an edge case and may well be acceptable; reporting it in case the silent zero value is not intended, since
selackis a list of integers andNoneis not a valid entry.Scapy version
master at c5e9a5b (2026-09-26)
Python version
3.10
Operating system
Linux (Docker)
Additional environment information
No response
How to reproduce
Actual result
selackLenstays 0, but the packet is 4 bytes longer thanraw(OpcDaFack())(17 bytes): theNoneentry is written as a zero integer, so the length field and the list disagree.Expected result
An error for the invalid
Noneentry, as before, or at least a length field consistent with the list.Related resources
#5095 (cc @mmadersbacher). Found by differential testing of recent pull requests and reproduced by hand on current master.