From ca4eddd56712a5b7984395601b63dd79e7a8abd6 Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 4 Feb 2020 23:52:59 +0100 Subject: Add source.allow_road_warriors option. --- src/manager/builder.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/manager') 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 -- cgit