[client] Skip the sweeper dial option without a netevents manager

Review feedback on #7254: restore the nil guard around WithSweeper in the
signal and management clients. The nil *Manager is safe through the whole
dial chain, but passing it into the Sweeper interface hides that behind a
typed nil, and on desktop, where the manager is always nil, the extra
context dialer overrode WithCustomDialer just to be a no-op.
This commit is contained in:
Zoltán Papp
2026-08-25 15:15:07 +02:00
parent 0a03211903
commit c542dae2b5
2 changed files with 6 additions and 2 deletions

View File

@@ -142,7 +142,9 @@ func NewClient(ctx context.Context, addr string, ourPrivateKey wgtypes.Key, tlsE
extraOpts = append(extraOpts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxSize)))
log.Infof("management gRPC max receive message size set to %d bytes", maxSize)
}
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
if c.netMgr != nil {
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
}
var conn *grpc.ClientConn
operation := func() error {

View File

@@ -116,7 +116,9 @@ func NewClient(ctx context.Context, addr string, key wgtypes.Key, tlsEnabled boo
}
var extraOpts []grpc.DialOption
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
if c.netMgr != nil {
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
}
var conn *grpc.ClientConn
operation := func() error {