summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-01-06 23:36:41 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-01-06 23:36:41 +0000
commit5b09c1bbd695977dd5b2276a7a13998861c304d3 (patch)
treea8a974c50fba394b56a984ccb103a2e572576e56 /usr.sbin
parentc9eb27d54ac859ca7ee7c12c7493f1813366697e (diff)
small bug that was not so easy to fix: we did not allow empty lines (or
comment-only lines) in the middle of neighbor/group blocks. as first or last line in thise blocks they were accepted, but not in between. ok deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/parse.y19
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index a2d171710f1..facc911dc79 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.32 2004/01/06 20:41:55 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.33 2004/01/06 23:36:40 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -217,6 +217,9 @@ optnl : '\n' optnl
|
;
+nl : '\n' optnl /* one newline or more */
+ ;
+
optnumber : /* empty */ { $$ = 0; }
| number
;
@@ -229,7 +232,7 @@ neighbor : NEIGHBOR address optnl '{' optnl {
curpeer->conf.remote_addr.sin_port = htons(BGP_PORT);
curpeer->conf.remote_addr.sin_addr.s_addr = $2.s_addr;
}
- peeropts_l optnl '}' {
+ peeropts_l '}' {
curpeer->next = peer_l;
peer_l = curpeer;
curpeer = NULL;
@@ -246,7 +249,7 @@ group : GROUP string optnl '{' optnl {
YYERROR;
}
}
- groupopts_l optnl '}' {
+ groupopts_l '}' {
free(curgroup);
curgroup = NULL;
}
@@ -256,17 +259,17 @@ groupopts_l : groupopts_l groupoptsl
| groupoptsl
;
-groupoptsl : peeropts '\n'
- | neighbor '\n'
- | error '\n'
+groupoptsl : peeropts nl
+ | neighbor nl
+ | error nl
;
peeropts_l : peeropts_l peeroptsl
| peeroptsl
;
-peeroptsl : peeropts '\n'
- | error '\n'
+peeroptsl : peeropts nl
+ | error nl
;
peeropts : REMOTEAS number {