Skip to content

Commit 9af1797

Browse files
committed
chore: remove unused context/cancel in tailnet Conn
1 parent 58cecd4 commit 9af1797

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

tailnet/conn.go

-6
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,9 @@ func NewConn(options *Options) (conn *Conn, err error) {
282282
Logger(options.Logger.Named("net.packet-filter")),
283283
))
284284

285-
dialContext, dialCancel := context.WithCancel(context.Background())
286285
server := &Conn{
287286
blockEndpoints: options.BlockEndpoints,
288287
derpForceWebSockets: options.DERPForceWebSockets,
289-
dialContext: dialContext,
290-
dialCancel: dialCancel,
291288
closed: make(chan struct{}),
292289
logger: options.Logger,
293290
magicConn: magicConn,
@@ -392,8 +389,6 @@ func IPFromUUID(uid uuid.UUID) netip.Addr {
392389

393390
// Conn is an actively listening Wireguard connection.
394391
type Conn struct {
395-
dialContext context.Context
396-
dialCancel context.CancelFunc
397392
mutex sync.Mutex
398393
closed chan struct{}
399394
logger slog.Logger
@@ -789,7 +784,6 @@ func (c *Conn) Close() error {
789784

790785
_ = c.netStack.Close()
791786
c.logger.Debug(context.Background(), "closed netstack")
792-
c.dialCancel()
793787
_ = c.wireguardMonitor.Close()
794788
_ = c.dialer.Close()
795789
// Stops internals, e.g. tunDevice, magicConn and dnsManager.

0 commit comments

Comments
 (0)