aboutsummaryrefslogtreecommitdiff
path: root/src/manager
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager')
-rw-r--r--src/manager/builder.rs4
-rw-r--r--src/manager/mod.rs6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/manager/builder.rs b/src/manager/builder.rs
index 9580d07..6ee71f2 100644
--- a/src/manager/builder.rs
+++ b/src/manager/builder.rs
@@ -135,7 +135,7 @@ fn insert_peer<'b>(
err: &mut Vec<Error>,
src: &Source,
p: &proto::Peer,
- psk: Option<&model::Key>,
+ psk: Option<&model::Secret>,
update: impl for<'c> FnOnce(&'c mut model::Peer) -> (),
) -> &'b mut model::Peer {
match c.peers.entry(p.public_key) {
@@ -161,7 +161,7 @@ fn find_psk<'a>(
gc: &'a config::GlobalConfig,
src: &'a Source,
p: &proto::Peer,
-) -> Result<Option<&'a model::Key>, Error> {
+) -> Result<Option<&'a model::Secret>, Error> {
let want = match gc.peers.get(&p.public_key) {
Some(v) => v,
None => return Ok(None),
diff --git a/src/manager/mod.rs b/src/manager/mod.rs
index 8df4d23..b7fb8c2 100644
--- a/src/manager/mod.rs
+++ b/src/manager/mod.rs
@@ -35,10 +35,12 @@ impl Manager {
let runtime_directory = c.runtime_directory.ok_or_else(|| {
io::Error::new(io::ErrorKind::InvalidInput, "runtime directory required")
})?;
- let mut state_path = runtime_directory.clone();
+
+ let mut state_path = runtime_directory;
state_path.push("state.json");
+
let mut m = Self {
- dev: wg::Device::open(ifname, runtime_directory)?,
+ dev: wg::Device::open(ifname)?,
global_config: c.global,
sources: vec![],
current: model::Config::empty(),