Skip to content

Commit 94ae966

Browse files
committed
test(roundtrip): drop the edge-case gaps that #1460, #1462 and #1463 fixed
#1454 merged before the three fixes, so its stale-entry check now fails on main: #1455 (L2TPv2/OSPF trailer), #1456/#1457 (RPL) and #1459 (HIP fixed bits) all come back OK. Drop those entries. The HIP fixed-bit cuts and two RPL in-IPv6 cut55 cases now parse but zero-fill, so they move under the #1451/#1458 short-read gaps. All four edge modules pass.
1 parent c7cec9c commit 94ae966

2 files changed

Lines changed: 4 additions & 49 deletions

File tree

‎tests/protocols/internet/test_internet_edge_roundtrip_unit.py‎

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -251,42 +251,6 @@ def hip_param(code: int, body: bytes) -> bytes:
251251
}
252252

253253
KNOWN_FAILURES = (
254-
Gap(1456,
255-
'An RPL Source Route header under an IPv6 header parses with its compressed '
256-
'addresses expanded against the IPv6 destination, and the rebuild writes them '
257-
'back at 16 octets each, with CmprI/CmprE unchanged and Hdr Ext Len recomputed '
258-
'from the 16-octet vector: ``_make_data_type_rpl`` takes ``addr.packed`` without '
259-
'the ``[cmpr_i:]``/``[cmpr_e:]`` slice its ``ip=`` branch applies '
260-
'(pcapkit/protocols/internet/ipv6_route.py:795-797). Standalone, with no '
261-
'destination to expand against, the addresses stay bytes and round-trip.',
262-
# The rebuilt routing header's first five octets: Hdr Ext Len grown, or
263-
# (cut63) the first address written out at 16 octets.
264-
'MISMATCH', ('023b100301ff', '023b04030188', '023b0303010f', '023b050301cd', '023b0e0301ff',
265-
'023b0203018800000000000000000000000102'),
266-
('ipv6-route/rpl-cmpr-15-15-x8/in-ipv6', 'ipv6-route/rpl-cmpr-8-8-x2/in-ipv6',
267-
'ipv6-route/rpl-cmpr-0-15-pad7/in-ipv6', 'ipv6-route/rpl-cmpr-12-13-pad1/in-ipv6',
268-
'ipv6-route/rpl-cmpr-15-15-x8/in-ipv6/cut55', 'ipv6-route/rpl-cmpr-8-8-x2/in-ipv6/cut63',
269-
'ipv6-route/rpl-cmpr-0-15-pad7/in-ipv6/cut55', 'ipv6-route/rpl-cmpr-12-13-pad1/in-ipv6/cut55')),
270-
Gap(1457,
271-
'A truncated RPL address vector is split by the octets actually read, not by '
272-
'Hdr Ext Len (``RPL.post_process``, pcapkit/protocols/schema/internet/ipv6_route.py:280-305). '
273-
'A short uncompressed address leaks ``ValueError`` from ``ipaddress.ip_address`` '
274-
'(PARSE); otherwise the rebuild recomputes Hdr Ext Len from the addresses read, '
275-
'so it either fails the reader\'s own length check '
276-
'(``IPv6-Route: [TypeNo 3] invalid format``, REBUILD) or writes a smaller one '
277-
'(MISMATCH).',
278-
('PARSE', 'REBUILD', 'MISMATCH'),
279-
('ValueError: ', 'IPv6-Route: [TypeNo 3] invalid format', 'octets 3b010301880000000102'),
280-
('ipv6-route/rpl-uncompressed/cut*', 'ipv6-route/rpl-uncompressed/extension/cut*',
281-
'ipv6-route/rpl-cmpr-15-0-x1/cut*', 'ipv6-route/rpl-cmpr-15-0-x1/extension/cut*',
282-
'ipv6-route/rpl-cmpr-15-15-x8/cut8', 'ipv6-route/rpl-cmpr-15-15-x8/extension/cut8',
283-
'ipv6-route/rpl-cmpr-8-8-x2/cut*', 'ipv6-route/rpl-cmpr-8-8-x2/extension/cut*')),
284-
Gap(1459,
285-
'HIP rejects a packet whose two fixed bits (the leading bit of Packet Type, '
286-
'the trailing bit of Version) are not 0 and 1, where RFC 7401 section 5.1 '
287-
'says a receiver MUST ignore them; the parse raises ``ProtocolError``.',
288-
'REJECTED', 'ProtocolError: HIP: invalid format',
289-
('hip/fixed-bit-clear', 'hip/leading-bit-set')),
290254
Gap(1451, edge.ZERO_FILLED_EXTENSION_HEADER, 'PADDED', '',
291255
('ipv6-route/unassigned-type/cut*', 'ipv6-route/unassigned-type-24-octets/cut*',
292256
'ipv6-route/type0-no-address/cut*', 'ipv6-route/type0-reserved-set/cut*',
@@ -312,9 +276,11 @@ def hip_param(code: int, body: bytes) -> bytes:
312276
'hip/no-parameters/cut*', 'hip/packet-type-0-reserved/cut*',
313277
'hip/packet-type-127-unassigned/cut*', 'hip/version-1/cut*', 'hip/version-15/cut*',
314278
'hip/every-control-bit/cut*', 'hip/next-tcp-no-payload/cut*',
315-
'hip/no-parameters/not-extension/cut*')),
279+
'hip/no-parameters/not-extension/cut*',
280+
'hip/fixed-bit-clear/cut*', 'hip/leading-bit-set/cut*')),
316281
Gap(1458, edge.ZERO_FILLED_SHORT_READ, 'PADDED', '',
317-
('ipx/min-header/cut*', 'ipx/transport-control-255/cut*',
282+
('ipv6-route/rpl-cmpr-0-15-pad7/in-ipv6/cut55', 'ipv6-route/rpl-cmpr-12-13-pad1/in-ipv6/cut55',
283+
'ipx/min-header/cut*', 'ipx/transport-control-255/cut*',
318284
'ipx/unassigned-packet-type/cut16', 'ipx/length-short-of-the-data/cut15',
319285
'ipx/checksum-not-ffff/cut*', 'ipx/length-past-the-data/cut16',
320286
'ipv6/no-next-header-empty/cut*', 'ipv6/no-next-header-with-octets/cut22',

‎tests/protocols/link/test_link_edge_roundtrip_unit.py‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,6 @@ def ospf(type_: int = 1, plen: 'int | None' = None, auth: int = 0,
120120
}
121121

122122
KNOWN_FAILURES = (
123-
Gap(1455,
124-
'Octets past a length field shorter than the data are kept by the parse '
125-
'(``data``) but not by ``info``, so ``from_data`` drops them. IPv4 and '
126-
'IPv6 keep them as ``trailer``; L2TPv2 (Length) and OSPF (Packet Length) '
127-
'have no such key. pcapkit/protocols/link/l2tpv2.py, '
128-
'pcapkit/protocols/application/ospf.py',
129-
# The rebuild stops at the declared length.
130-
'MISMATCH', ('8 octets 4002000800010002 != ',
131-
'24 octets 020100180102030400000000abcd00000000000000000000 != '),
132-
('l2tpv2/length-short-of-the-data', 'l2tpv2/length-short-of-the-data/cut9',
133-
'ospf/packet-length-short-of-the-data', 'ospf/packet-length-short-of-the-data/cut25')),
134123
Gap(1458, edge.ZERO_FILLED_SHORT_READ, 'PADDED', '',
135124
('ethernet/header-only-*/cut*', 'ethernet/length-field-0/cut7',
136125
'ethernet/length-field-1500/cut9', 'ethernet/unassigned-type-ffff/cut8',

0 commit comments

Comments
 (0)