From ae1da6974aa8ca437e0a4070da1ebbf7b181e2e2 Mon Sep 17 00:00:00 2001 From: Tatsushi Demachi Date: Wed, 10 May 2017 08:59:07 +0900 Subject: table: Advertise local-pref set by import policy At importing a path from an external peer, LOCAL_PREF can be set by an import policy but at exporting a best path to an internal peer, this learned, calculated LOCAL_PREF is never used and every time overwritten by a default value 100. According to RFC 4271 "5.1.5. LOCAL_PREF" and "9.1.1. Phase 1: Calculation of Degree of Preference", the learned value should be advertised to other internal peers. This fixes it by just removing resetting a non-local path's LOCAL_PREF by the default value. --- table/path.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'table') diff --git a/table/path.go b/table/path.go index 89c32a16..ef63d720 100644 --- a/table/path.go +++ b/table/path.go @@ -215,7 +215,7 @@ func UpdatePathAttrs(global *config.Global, peer *config.Neighbor, info *PeerInf // For iBGP peers we are required to send local-pref attribute // for connected or local prefixes. // We set default local-pref 100. - if pref := path.getPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF); pref == nil || !path.IsLocal() { + if pref := path.getPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF); pref == nil { path.setPathAttr(bgp.NewPathAttributeLocalPref(DEFAULT_LOCAL_PREF)) } -- cgit v1.2.3