summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-08-24 03:17:50 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-08-24 03:17:50 +0200
commit25c9d9351636be717664e745395fe016b86911be (patch)
treeb55938c20ca0e0cd60b320c35df347767987820f /src
parente7b0801809d55fb41b7aa2987623743d3be90e99 (diff)
downloadfastd-25c9d9351636be717664e745395fe016b86911be.tar
fastd-25c9d9351636be717664e745395fe016b86911be.zip
Improve error messages for invalid static peers
Diffstat (limited to 'src')
-rw-r--r--src/config.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/config.y b/src/config.y
index 44fc59f..389cf31 100644
--- a/src/config.y
+++ b/src/config.y
@@ -429,8 +429,10 @@ peer: TOK_STRING {
;
peer_after: {
- if (!fastd_peer_add(state->peer))
+ if (!fastd_peer_add(state->peer)) {
+ fastd_config_error(&@$, state, "invalid peer definition");
YYERROR;
+ }
}
peer_conf: peer_conf peer_statement
@@ -542,8 +544,10 @@ include: TOK_PEER TOK_STRING maybe_as {
if (!fastd_config_read($2->str, state->peer_group, peer, state->depth))
YYERROR;
- if (!fastd_peer_add(peer))
+ if (!fastd_peer_add(peer)) {
+ fastd_config_error(&@$, state, "invalid peer definition");
YYERROR;
+ }
}
| TOK_PEERS TOK_FROM TOK_STRING {
fastd_config_add_peer_dir(state->peer_group, $3->str);