diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-25 17:51:47 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-04-25 17:51:47 +0000 |
commit | 6c7f75cbf4943531e2f05f820e0c40b77b13a340 (patch) | |
tree | 04787badb81fd266e4937fd31a318c458945b583 /usr.sbin/bgpd | |
parent | cc6ec2a76dd7a33c8a4c6fcceda672954f603584 (diff) |
fix check wether local-address and neighbor are of same address family -
we have to delay this because the current context might be a group nd not
a single neighbor, claudio ok
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 758ae6b2269..1dbae73d6e8 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.80 2004/04/25 07:16:24 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.81 2004/04/25 17:51:46 henning Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -380,6 +380,14 @@ neighbor : { curpeer = new_peer(); } } } peeropts_l '}' { + if (curpeer->conf.local_addr.af && + curpeer->conf.local_addr.af != + curpeer->conf.remote_addr.af) { + yyerror("local-address and neighbor address " + "must be of the same address family"); + YYERROR; + } + curpeer->next = peer_l; peer_l = curpeer; curpeer = NULL; @@ -440,11 +448,6 @@ peeropts : REMOTEAS asnumber { free($2); } | LOCALADDR address { - if ($2.af != curpeer->conf.remote_addr.af) { - yyerror("local-address and neighbor address " - "must be of the same address family"); - YYERROR; - } memcpy(&curpeer->conf.local_addr, &$2, sizeof(curpeer->conf.local_addr)); } |