diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 16:35:38 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 16:35:38 +0000 |
commit | 9b9c703dd1b5c705527e9facd676ff619a5ca606 (patch) | |
tree | 3f7cd19930de37f92112ce414296315f63931a49 /usr.sbin/ldpd/parse.y | |
parent | 9e0636e7e7be4ffcb6f696d956772333828f27dd (diff) |
Do not accept incomplete pseudowires in the configuration.
There's no point on keeping in the config something that can not be used,
it just adds unnecessary complexity. Also, it's better to warn the user
that there's something wrong rather than play nice and ignore the problem.
Diffstat (limited to 'usr.sbin/ldpd/parse.y')
-rw-r--r-- | usr.sbin/ldpd/parse.y | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y index fbab8c23f46..a771ab8f46a 100644 --- a/usr.sbin/ldpd/parse.y +++ b/usr.sbin/ldpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.40 2016/05/23 16:20:59 renato Exp $ */ +/* $OpenBSD: parse.y,v 1.41 2016/05/23 16:35:37 renato Exp $ */ /* * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org> @@ -402,6 +402,16 @@ pseudowire : PSEUDOWIRE STRING { struct l2vpn *l; struct l2vpn_pw *p; + /* check for errors */ + if (pw->pwid == 0) { + yyerror("missing pseudowire id"); + YYERROR; + } + if (pw->addr.s_addr == INADDR_ANY) { + yyerror("missing pseudowore neighbor"); + YYERROR; + } + LIST_FOREACH(l, &conf->l2vpn_list, entry) LIST_FOREACH(p, &l->pw_list, entry) if (pw != p && |