Fix #2926: parse_iface_attributes: always break on non-{attribitue, comment} token

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@proxmox.com>
This commit is contained in:
Fabian Ebner
2020-08-13 15:04:12 +02:00
committed by Dietmar Maurer
parent 93bb51fe7e
commit 87c4cb7419
2 changed files with 98 additions and 3 deletions

View File

@ -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()? {