chore: fix some comments (#2069)

This commit is contained in:
curlwget 2024-09-09 20:17:25 +08:00 committed by GitHub
parent c3b260a6f7
commit 99f18f9cd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -227,7 +227,7 @@ func (m *Mapper) FullMapResponse(
return m.marshalMapResponse(mapRequest, resp, node, mapRequest.Compress, messages...) return m.marshalMapResponse(mapRequest, resp, node, mapRequest.Compress, messages...)
} }
// ReadOnlyResponse returns a MapResponse for the given node. // ReadOnlyMapResponse returns a MapResponse for the given node.
// Lite means that the peers has been omitted, this is intended // Lite means that the peers has been omitted, this is intended
// to be used to answer MapRequests with OmitPeers set to true. // to be used to answer MapRequests with OmitPeers set to true.
func (m *Mapper) ReadOnlyMapResponse( func (m *Mapper) ReadOnlyMapResponse(
@ -552,7 +552,7 @@ func appendPeerChanges(
} }
// If there are filter rules present, see if there are any nodes that cannot // If there are filter rules present, see if there are any nodes that cannot
// access eachother at all and remove them from the peers. // access each-other at all and remove them from the peers.
if len(packetFilter) > 0 { if len(packetFilter) > 0 {
changed = policy.FilterNodesByACL(node, changed, packetFilter) changed = policy.FilterNodesByACL(node, changed, packetFilter)
} }
@ -596,7 +596,7 @@ func appendPeerChanges(
} else { } else {
// This is a hack to avoid sending an empty list of packet filters. // This is a hack to avoid sending an empty list of packet filters.
// Since tailcfg.PacketFilter has omitempty, any empty PacketFilter will // Since tailcfg.PacketFilter has omitempty, any empty PacketFilter will
// be omitted, causing the client to consider it unchange, keeping the // be omitted, causing the client to consider it unchanged, keeping the
// previous packet filter. Worst case, this can cause a node that previously // previous packet filter. Worst case, this can cause a node that previously
// has access to a node to _not_ loose access if an empty (allow none) is sent. // has access to a node to _not_ loose access if an empty (allow none) is sent.
reduced := policy.ReduceFilterRules(node, packetFilter) reduced := policy.ReduceFilterRules(node, packetFilter)