[pbs-devel] [PATCH proxmox-backup] Fix #2926: parse_iface_attributes: always break on non-{attribitue, comment} token

Fabian Ebner f.ebner at proxmox.com
Wed Aug 12 14:29:29 CEST 2020


There is no requirement to have at least
a blank line, attribute or comment in between two
interface definitions, e.g.
iface lo inet loopback
iface lo inet6 loopback

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/config/network/parser.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/config/network/parser.rs b/src/config/network/parser.rs
index 071bbcc7..a97d0f79 100644
--- a/src/config/network/parser.rs
+++ b/src/config/network/parser.rs
@@ -210,9 +210,7 @@ impl <R: BufRead> NetworkParser<R> {
                     self.eat(Token::Newline)?;
                     continue;
                 }
-                Token::Newline => break,
-                Token::EOF => break,
-                unexpected => bail!("unexpected token {:?} (expected iface attribute)", unexpected),
+                _ => break,
             }
 
             match self.peek()? {
-- 
2.20.1






More information about the pbs-devel mailing list