summaryrefslogtreecommitdiff
path: root/proto/bgp/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-10-02 11:33:55 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2014-10-02 12:52:50 +0200
commitdcde7ae597ccb7d81648b9ecab7c0f61c88e60f2 (patch)
tree673dd152c3e3758ae1a41e89324f8b3334e21bf7 /proto/bgp/config.Y
parent252c7e4d0b7b45c89f69b3c4763b0c013aa5830d (diff)
Allows to configure different remote port for BGP sessions.
Thanks to João Taveira Araújo for the original patch.
Diffstat (limited to 'proto/bgp/config.Y')
-rw-r--r--proto/bgp/config.Y5
1 files changed, 3 insertions, 2 deletions
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y
index 4d085d42..8e0b2412 100644
--- a/proto/bgp/config.Y
+++ b/proto/bgp/config.Y
@@ -60,7 +60,7 @@ bgp_proto:
| bgp_proto proto_item ';'
| bgp_proto LOCAL AS expr ';' { BGP_CFG->local_as = $4; }
| bgp_proto LOCAL ipa AS expr ';' { BGP_CFG->source_addr = $3; BGP_CFG->local_as = $5; }
- | bgp_proto NEIGHBOR ipa ipa_scope AS expr ';' {
+ | bgp_proto NEIGHBOR ipa ipa_scope ipa_port AS expr ';' {
if (ipa_nonzero(BGP_CFG->remote_ip))
cf_error("Only one neighbor per BGP instance is allowed");
if (!ipa_has_link_scope($3) != !$4)
@@ -68,7 +68,8 @@ bgp_proto:
BGP_CFG->remote_ip = $3;
BGP_CFG->iface = $4;
- BGP_CFG->remote_as = $6;
+ BGP_CFG->remote_port = ($5 > 0) ? $5 : BGP_PORT;
+ BGP_CFG->remote_as = $7;
}
| bgp_proto RR CLUSTER ID idval ';' { BGP_CFG->rr_cluster_id = $5; }
| bgp_proto RR CLIENT ';' { BGP_CFG->rr_client = 1; }