Skip to content

server: apply TCP-AO to peer sockets - #3584

Open
rastislavs wants to merge 1 commit into
osrg:masterfrom
rastislavs:tcp-ao-peer
Open

server: apply TCP-AO to peer sockets#3584
rastislavs wants to merge 1 commit into
osrg:masterfrom
rastislavs:tcp-ao-peer

Conversation

@rastislavs

Copy link
Copy Markdown
Contributor

Part of TCP-AO implementation (#3493) this PR actually applies configured TCP-AO keys to peer sockets and makes TCP-AO work end-to-end.

Dynamic peers are not yet supported, will be covered in a later PR.

Resolve each peer's configured TCP-AO keychain when the peer is added,
keep a reference on the FSM, and install or remove its keys on listening
and connected sockets.

Passive peers have all configured keys installed on matching
listening sockets before the peer starts; no key is selected
on the listener. Once an inbound connection is accepted
and matched to the peer, select the configured send key
as both CurrentKey and RNextKey before passing the connection to the FSM.
Active peers install all keys from net.Dialer.Control before connect
and mark the preferred key during installation, so the initial SYN uses it.

Attaching, removing, or changing a keychain always uses the existing
peer delete-and-add path and therefore restarts the session.
A send ID change within the same keychain is handled
live by updating RNext on the current connection.

Management operations serialize peer and keychain changes. Socket key material
is copied and cleared after use. Listener updates use their raw socket handles
directly; existing connection updates hold the FSM mutex while reading fsm.conn
and issuing the socket options, avoiding a select-then-use window in this path.

Keychain key additions and deletions update the in-memory keychain first,
then propagate to listeners and established connections.
Per-socket failures are logged rather than rolling back the request,
so propagation is best effort and can be partial. Users can use
state data retrieval to confirm keychain changes have sucesfully
propagated to all affected peers.
@rastislavs rastislavs mentioned this pull request Sep 2, 2026
8 tasks
@rastislavs
rastislavs marked this pull request as ready for review September 2, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant