Fix MSS clamp loading the option as an IPv6 exthdr #19

Merged
benvin merged 2 commits from benvin/mss-clamp-tcpopt into main 2026-10-03 21:15:19 +10:00
Member

The MSS clamp rule loads the MSS option with exthdr op 0 (IPv6), so the kernel lists it as unknown-exthdr ... [invalid type] and the size comparison never matches TCP options; the clamp is ineffective.

  • use ExthdrOpTcpopt for both the MSS load and write, rendering as tcp option maxseg size > N tcp option maxseg size set N
  • assert the emitted clamp exprs in TestCompile_MSSClamp
The MSS clamp rule loads the MSS option with exthdr op 0 (IPv6), so the kernel lists it as `unknown-exthdr ... [invalid type]` and the size comparison never matches TCP options; the clamp is ineffective. - use `ExthdrOpTcpopt` for both the MSS load and write, rendering as `tcp option maxseg size > N tcp option maxseg size set N` - assert the emitted clamp exprs in `TestCompile_MSSClamp`
unkin-agent added 1 commit 2026-10-03 20:50:15 +10:00
Load MSS option via tcpopt exthdr op in clamp rule
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ed3209681d
Author
Member

No findings.

No findings.
unkin-agent added 1 commit 2026-10-03 21:14:16 +10:00
Merge remote-tracking branch 'origin/main' into benvin/mss-clamp-tcpopt
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
abbf434af5
# Conflicts:
#	internal/nftables/compiler_test.go
benvin merged commit 3687baabe5 into main 2026-10-03 21:15:19 +10:00
benvin deleted branch benvin/mss-clamp-tcpopt 2026-10-03 21:15:19 +10:00
Sign in to join this conversation.