You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bdf5c99
Browse filesBrowse the repository at this point in the historyBrowse files
fix(protocols): report a rebuilt frame's messages once and record cuts on the layer (#2711) (#2738)
- Rebuilding an outer layer rebuilt its payload by from_data, whose own parse
reported what the octets carry, and then parsed them again itself, so
Ethernet over a cut IGMPv3 reported its messages twice. Under rebuilding,
ProtocolBase.__post_init__ drops the payload's parse warnings with
hold_warnings, and beholder builds the errors it absorbs quiet through
CaughtByCaller and logs none; the enclosing layer's parse reports them once.
The owner ruled on #2711 that this carve-out from the handled-refusals rule
stands, as protocol-family-grouping.rst now records.
- An IGMPv3 Report parsed on its own and cut on a field boundary before its
counted records read INVALID. ListField now takes a count: a list whose
octets hold fewer items than it counts reports the shortfall, and
Schema.unpack records it as a short read, the items absent never made up;
the fields after it find the record in packet, as #2727 gives them.
Report.records counts num_group_records for a message parsed on its own, so
such a cut reads TRUNCATED whatever the context parsed before; inside a frame
the count sizes nothing. A count no IP payload could carry raises
ProtocolError.
- A message cut inside the length its context gives it read TRUNCATED in its
frame but INVALID rebuilt on its own. Schema.unpack records a cut in a payload
of a declared length; keep_short_read records a frame cut on a layer only
where Schema._frame_end_field finds its last field sized by what is left of
the length it was given, so a layer whose header declares its end (IPv4,
IPv6 and its extension headers, UDP, an HTTP/2 frame) records none at or past
it, nor one ending in a list, as SCTP's chunks, whose buffer holds only what
its items took. The TSO IPv4 payload is sized that way, and ICMPv4 reads a
recorded cut as TRUNCATED, as GRE and IGMP do.
- Tests that pinned no record for those cuts now pin the record.
The new modules fail without the fix; the protocols, corekit, foundation,
utilities and project modules pass. Sample captures give the same octets and
messages; cut frames gain __short_read__ on Ethernet, IPv4 and UDP.
Closes#2711
0 commit comments