@@ -64,7 +64,7 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
}, nil
}
goStdKeepAlive := time.Duration(0)
- if sockopt.TcpKeepAliveIdle != 0 {
+ if sockopt != nil && sockopt.TcpKeepAliveIdle != 0 {
goStdKeepAlive = time.Duration(-1)
dialer := &net.Dialer{
@@ -50,7 +50,7 @@ func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *S
network = addr.Network()
address = addr.String()
lc.Control = getControlFunc(ctx, sockopt, dl.controllers)
lc.KeepAlive = time.Duration(-1)
case *net.UnixAddr: