Repository navigation
feat(mesh): divert mark + route table constants; ProxyTCPOutboundPort → ProxyL4OutboundPort - #945
Merged
Merged
Conversation
… -> ProxyL4OutboundPort PR 1 of the TPROXY plan (proposal 038, revised). Constants and names only -- no behaviour changes -- so the CNI and agent PRs that follow have a vocabulary to build against. CaptureDivertFwMark = 0xae71 and CaptureDivertRouteTable = 100 join CapturePassthroughFwMark = 0xae7e. The divert mark is what the CNI's OUTPUT rule will set; a policy-routing rule delivers marked packets locally with the IP header INTACT and a prerouting tproxy hands them to the transparent capture socket. Same 0xae7x family as the passthrough mark so the two read as related in `nft list ruleset`; a distinct value, and neither is a bitmask superset of the other, so the passthrough accept can never match a diverted packet. TestCaptureMarksAreDisjoint pins that (seen red on a 0xae7e == 0xae7e probe: "the passthrough accept would swallow every diverted packet"). ProxyTCPOutboundPort -> ProxyL4OutboundPort, value unchanged. Under 038 D1 plaintext UDP dials the same 18082 as raw TCP -- one number, both transports, the way 18008 and 18009 are shared -- so the name stopped being true. TestL4OutboundPortIsSharedAcrossTransports gates it the way #942 gates 18009: any transport-specific outbound port constant in this package must equal 18082 (seen red on a `ProxyUDPOutboundPort = 18083` probe, naming it). Comments corrected where the rename made them false: ProxyCapturePort no longer claims "both TCP and UDP bind" it (UDP binds the dialed port, because a datagram reply's source port is the socket's bound port and cannot be rewritten); the CNI's UDP-18081 REDIRECT is marked stale-by-design and points at 038; the passthrough mark's comment now records that it never matches in practice (proxy egress is in the host netns, rules in the pod netns). Refs #916 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 1 of the TPROXY plan (proposal 038, revised). Constants and names only — no behaviour changes — so the CNI and agent PRs that follow have a vocabulary to build against. Refs #916.
New constants
CaptureDivertFwMark = 0xae71andCaptureDivertRouteTable = 100joinCapturePassthroughFwMark = 0xae7e. The divert mark is what the CNI's OUTPUT rule will set; a policy-routing rule delivers marked packets locally with the IP header intact, and a preroutingtproxyhands them to the transparent capture socket.Same
0xae7xfamily as the passthrough mark so the two read as related innft list ruleset; a distinct value, and neither is a bitmask superset of the other, so the passthrough accept can never match a diverted packet.TestCaptureMarksAreDisjointpins that — seen red on a0xae7e == 0xae7eprobe:The rename
ProxyTCPOutboundPort → ProxyL4OutboundPort, value unchanged (18082). Under 038 D1 plaintext UDP dials the same number as raw TCP — one number, both transports, the way 18008 and 18009 are shared — so the name stopped being true. Mechanical across 7 files.TestL4OutboundPortIsSharedAcrossTransportsgates it the way #942 gates 18009: any transport-specific outbound port constant in the package must equal 18082. Seen red on aProxyUDPOutboundPort = 18083probe, naming it. Embeds*.goso the scan is real under Bazel's sandbox.Comments corrected where the rename made them false
ProxyCapturePortno longer claims "both TCP and UDP bind" it. UDP binds the dialed port, because a datagram reply's source port is the socket's bound port and cannot be rewritten.Verification
bazel test //...109/109. Lint clean. Both new gates proven red then restored.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr