From bd781685508ae5096f864ba969824e299c7f327c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 1 Apr 2012 22:28:31 +0200 Subject: Require port with peer specfication, remove default port --- src/config.y | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/config.y') diff --git a/src/config.y b/src/config.y index fd60d0d..d4b9af6 100644 --- a/src/config.y +++ b/src/config.y @@ -96,7 +96,6 @@ %type port %type maybe_port -%type maybe_port_default %type maybe_as %% @@ -188,15 +187,15 @@ peer_statement: TOK_ADDRESS peer_address ';' | TOK_INCLUDE peer_include ';' ; -peer_address: TOK_ADDR maybe_port_default { +peer_address: TOK_ADDR ':' port { conf->peers->address.in.sin_family = AF_INET; conf->peers->address.in.sin_addr = $1; - conf->peers->address.in.sin_port = $2; + conf->peers->address.in.sin_port = $3; } - | TOK_ADDR6 maybe_port_default { + | TOK_ADDR6 ':' port { conf->peers->address.in6.sin6_family = AF_INET6; conf->peers->address.in6.sin6_addr = $1; - conf->peers->address.in6.sin6_port = $2; + conf->peers->address.in6.sin6_port = $3; } ; @@ -230,10 +229,6 @@ maybe_port: ':' port { $$ = $2; } | { $$ = 0; } ; -maybe_port_default: ':' port { $$ = $2; } - | { $$ = htons(1337); } - ; - maybe_as: TOK_AS TOK_STRING { $$ = $2; } | { $$ = NULL; } ; -- cgit v1.2.3