summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-02-05 23:50:55 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-02-05 23:50:55 +0000
commit63b3f097011dfd841110c0bec4b64308232ed3c6 (patch)
tree69c805c4b39b628f6ff7014844fb94b1ec3508d9 /usr.sbin/bgpd
parent4372ffe801330a8ed191ca252269fbd6c64a3d0e (diff)
allocate curpeer little earlier.
there's a rather obscure error path where teh later allocation causes trouble, claudio ok
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/parse.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 815d769b824..ef2388027f7 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.49 2004/02/05 14:42:45 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.50 2004/02/05 23:50:54 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -243,10 +243,10 @@ optnumber : /* empty */ { $$ = 0; }
| number
;
-neighbor : NEIGHBOR address optnl '{' optnl {
- curpeer = new_peer();
+neighbor : { curpeer = new_peer(); }
+ NEIGHBOR address optnl '{' optnl {
curpeer->conf.remote_addr.af = AF_INET;
- curpeer->conf.remote_addr.v4.s_addr = $2.s_addr;
+ curpeer->conf.remote_addr.v4.s_addr = $3.s_addr;
if (get_id(curpeer)) {
yyerror("get_id failed");
YYERROR;