Only let the configured peer connect #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/peer-ip-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A node configured to call
192.168.1.92connected fine to a different host (.198) on the same LAN — thepeer_hostsetting effectively didn't matter.Why
SignalingChannellistens on0.0.0.0and_handle_inboundadopted any inbound TCP connection as "the peer", never checking where it came from. So the control link (and the call) could run over a connection from any host on the network. Binding to a specific local IP wouldn't fix it — that constrains which local interface accepts, not which remote may connect.Change
peer_hostonce atstart()(viagetaddrinfo, off the event loop) into the set of source IPs we accept — covers an IP literal or a hostname with several addresses._handle_inbound, reject (log + close, don't adopt) any inbound connection whose source IP isn't in that set.Localhost dev/smoke configs (
127.0.0.1both sides) still match and connect. Verified directly: a channel configured for127.0.0.1adopts a loopback inbound; one configured for a different IP rejects and closes it.🤖 Generated with Claude Code