From 6c7f75cbf4943531e2f05f820e0c40b77b13a340 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sun, 25 Apr 2004 17:51:47 +0000 Subject: 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 --- usr.sbin/bgpd/parse.y | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'usr.sbin/bgpd/parse.y') 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 @@ -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)); } -- cgit v1.2.3