FR: Send Peers delta in MapResponse #489

Closed
opened 2025-12-29 02:18:59 +01:00 by adam · 4 comments
Owner

Originally created by @kev-the-dev on GitHub (Apr 27, 2023).

Feature request

I'm currently working on this feature and will submit my patch upstream, but creating a ticket to prevent duplicate work

This is a ticket to implement the sending of Peers list as deltas rather then the full list each time, per this TODO d0113732fe/api_common.go (L72).

In addition to improving performance, there is at least one bug I've found associated with not sending deltas:

  • There are two nodes in a tailnet, A and B
  • Node B is deleted
  • A MapResponse is generated for node A. Node A no longer has any peers, so len(MapResponse.Peers) == 0
  • Tailscale interprets len(MapResponse.Peers) == 0 as no change, meaning it isn't notified of node B being deleted 43819309e1/control/controlclient/map.go (L227)
  • Node B remains on tailnet after being deleted, causing a security vulnerability for deleted nodes
Originally created by @kev-the-dev on GitHub (Apr 27, 2023). **Feature request** **I'm currently working on this feature and will submit my patch upstream, but creating a ticket to prevent duplicate work** This is a ticket to implement the sending of Peers list as deltas rather then the full list each time, per this TODO https://github.com/juanfont/headscale/blob/d0113732fe1a3248456da84259f01967b4d09b49/api_common.go#L72. In addition to improving performance, there is at least one bug I've found associated with not sending deltas: * There are two nodes in a tailnet, A and B * Node B is deleted * A MapResponse is generated for node A. Node A no longer has any peers, so `len(MapResponse.Peers) == 0` * Tailscale interprets `len(MapResponse.Peers) == 0` as no change, meaning it isn't notified of node B being deleted https://github.com/tailscale/tailscale/blob/43819309e18ac7d496643fcd86489a2ee0927964/control/controlclient/map.go#L227 * Node B remains on tailnet after being deleted, causing a security vulnerability for deleted nodes
adam added the enhancement label 2025-12-29 02:18:59 +01:00
adam closed this issue 2025-12-29 02:18:59 +01:00
Author
Owner

@loprima-l commented on GitHub (Apr 28, 2023):

How is it going ? Do you have any issues ?

@loprima-l commented on GitHub (Apr 28, 2023): How is it going ? Do you have any issues ?
Author
Owner

@kev-the-dev commented on GitHub (Apr 28, 2023):

I have a working patch, just cleaning up and should be able to submit next week

@kev-the-dev commented on GitHub (Apr 28, 2023): I have a working patch, just cleaning up and should be able to submit next week
Author
Owner

@loprima-l commented on GitHub (Apr 28, 2023):

Nice, that's a good step on Headscale optimization, thanks for your investment.

@loprima-l commented on GitHub (Apr 28, 2023): Nice, that's a good step on Headscale optimization, thanks for your investment.
Author
Owner

@kradalby commented on GitHub (Sep 24, 2023):

This is implemented as part of #1492.

@kradalby commented on GitHub (Sep 24, 2023): This is implemented as part of #1492.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#489