MCPcopy Index your code
hub / github.com/coder/coder / filterLocked

Method filterLocked

tailnet/configmaps.go:377–392  ·  view source on GitHub ↗

filterLocked returns the current filter, based on our local addresses. c.L must be held.

()

Source from the content-addressed store, hash-verified

375// filterLocked returns the current filter, based on our local addresses. c.L
376// must be held.
377func (c *configMaps) filterLocked() *filter.Filter {
378 localIPSet := netipx.IPSetBuilder{}
379 for _, addr := range c.addresses {
380 localIPSet.AddPrefix(addr)
381 }
382 localIPs, _ := localIPSet.IPSet()
383 logIPSet := netipx.IPSetBuilder{}
384 logIPs, _ := logIPSet.IPSet()
385 return filter.New(
386 c.static.PacketFilter,
387 localIPs,
388 logIPs,
389 nil,
390 Logger(c.logger.Named("net.packet-filter")),
391 )
392}
393
394// updatePeers handles protocol updates about peers from the coordinator. c.L MUST NOT be held.
395func (c *configMaps) updatePeers(updates []*proto.CoordinateResponse_PeerUpdate) {

Callers 1

configLoopMethod · 0.95

Calls 3

NamedMethod · 0.80
LoggerFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected