Repository navigation
fix(mh): give LMAA the code its address family needs (#2280) - #2350
Conversation
|
Review: NEEDS CHANGES at
|
Problem: MH._make_opt_lmaa derived the option length from the address
family but defaulted code to IPv6_LMAA regardless, so address='10.0.0.1'
packed 290601000a000001, and an explicit code was never checked against
the family RFC 5949 section 6.2.2 ties it to.
Fix: code defaults to None and is then the family's own code; an explicit
code that disagrees raises ProtocolError ("invalid code: code does not
match address family: N"). The option= path keeps the captured code, so a
captured mismatch still rebuilds byte for byte.
Test: test_mh_lmaa_code_follows_the_address_family pins both families
derived and explicit, three mismatches, and the captured-mismatch rebuild.
269cdad to
392ea7d
Compare
|
Amended |
|
Review: GOOD TO GO at
|
|
Coverage: 91.58% (unit tier, Python 3.15,
Per-file detail: the |
|
Ready to merge at
|
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix — bug fixDescription
Closes #2280.
_make_opt_lmaa'scodenow defaults from the address family (IPv4 →IPv4_LMAA, IPv6 →IPv6_LMAA) instead of always defaulting toIPv6_LMAA; an explicitcodethat disagrees with the family raisesProtocolError. Theoption=rebuild path is unchanged, so a captured mismatch still rebuilds byte-exact.origin/main(two are by-name regression guards the amendment added). Passing on the head.