@@ -282,12 +282,9 @@ func NewConn(options *Options) (conn *Conn, err error) {
282282Logger (options .Logger .Named ("net.packet-filter" )),
283283))
284284
285- dialContext ,dialCancel := context .WithCancel (context .Background ())
286285server := & Conn {
287286blockEndpoints :options .BlockEndpoints ,
288287derpForceWebSockets :options .DERPForceWebSockets ,
289- dialContext :dialContext ,
290- dialCancel :dialCancel ,
291288closed :make (chan struct {}),
292289logger :options .Logger ,
293290magicConn :magicConn ,
@@ -392,8 +389,6 @@ func IPFromUUID(uid uuid.UUID) netip.Addr {
392389
393390// Conn is an actively listening Wireguard connection.
394391type Conn struct {
395- dialContext context.Context
396- dialCancel context.CancelFunc
397392mutex sync.Mutex
398393closed chan struct {}
399394logger slog.Logger
@@ -789,7 +784,6 @@ func (c *Conn) Close() error {
789784
790785_ = c .netStack .Close ()
791786c .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.