diff options
author | Hristo Venev <hristo@venev.name> | 2020-02-04 23:52:59 +0100 |
---|---|---|
committer | Hristo Venev <hristo@venev.name> | 2020-02-04 23:52:59 +0100 |
commit | ca4eddd56712a5b7984395601b63dd79e7a8abd6 (patch) | |
tree | 1d37d54a6cc8ade714c6a246b6ea952dc5ffec1c /src/manager/builder.rs | |
parent | 3744b8d130788f8b56d8eb6763586e89eb9a0647 (diff) |
Add source.allow_road_warriors option.
Diffstat (limited to 'src/manager/builder.rs')
-rw-r--r-- | src/manager/builder.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/manager/builder.rs b/src/manager/builder.rs index e302f7e..22fcca1 100644 --- a/src/manager/builder.rs +++ b/src/manager/builder.rs @@ -122,6 +122,15 @@ impl<'a> ConfigBuilder<'a> { } let ent = if p.base == self.public_key { + if !src.config.allow_road_warriors { + self.err.push(Error::new( + "road warriors from this source not allowed", + src, + &p.peer, + true, + )); + return; + } insert_peer(&mut self.c, &mut self.err, src, &p.peer, contact) } else if let Some(ent) = self.c.peers.get_mut(&p.base) { ent |