From dea9886454c1c0953b5977dd8a96718be465b962 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Fri, 8 Dec 2017 17:00:47 +0100 Subject: [PATCH] BGP: Link check just for single-hop --- proto/bgp/bgp.c | 4 ++++ proto/bgp/config.Y | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index a26c0cb9..f6d26639 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -1621,6 +1621,10 @@ bgp_postconfig(struct proto_config *CF) if (cf->multihop < 0) cf->multihop = internal ? 64 : 0; + /* Link check for single-hop BGP by default */ + if (cf->check_link < 0) + cf->check_link = !cf->multihop; + if (!cf->local_as) cf_error("Local AS number must be set"); diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index 0bd4c554..6ce0f1aa 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -58,7 +58,7 @@ bgp_proto_start: proto_start BGP { BGP_CFG->gr_mode = BGP_GR_AWARE; BGP_CFG->gr_time = 120; BGP_CFG->setkey = 1; - BGP_CFG->check_link = 1; + BGP_CFG->check_link = -1; } ;