fix handler related and some nit

Signed-off-by: KevinLiang10 <[email protected]>
This commit is contained in:
KevinLiang10 committed 2025-01-22 11:02:26 -05:00
1 parent 0a57051f2e
commit 550923d953
5 files changed
+39 -43

No files matched your search

+17 -1
View File
@@ -105,7 +105,7 @@ func (nm *NetworkMap) GetAddresses() views.Slice[netip.Prefix] {
// VIP addresses that correspond to the service. The service names are
// with the prefix "svc:".
//
// TODO(corp##25997): cache the result of decoding the capmap so that
// TODO(tailscale/corp##25997): cache the result of decoding the capmap so that
// we don't have to decode it multiple times after each netmap update.
func (nm *NetworkMap) GetVIPServiceIPMap() tailcfg.ServiceIPMappings {
if nm == nil {
@@ -425,3 +425,19 @@ const (
_ WGConfigFlags = 1 << iota
AllowSubnetRoutes
)
// IPServiceMappings maps IP addresses to service names. This is the inverse of
// [ServiceIPMappings], and is used to inform clients which services is an VIP
// address associated with. This is set to b.ipVIPServiceMap every time the
// netmap is updated. This is used to reduce the cost for looking up the service
// name for the dst IP address in the netStack packet processing workflow.
//
// This is of the form:
//
// {
// "100.65.32.1": "svc:samba",
// "fd7a:115c:a1e0::1234": "svc:samba",
// "100.102.42.3": "svc:web",
// "fd7a:115c:a1e0::abcd": "svc:web",
// }
type IPServiceMappings map[netip.Addr]string