summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorTatsushi Demachi <tdemachi@gmail.com>2017-05-10 08:59:07 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-05-10 15:32:44 +0900
commitae1da6974aa8ca437e0a4070da1ebbf7b181e2e2 (patch)
tree3b1e3ede67603f77604d9edde41b39376bef552e /table
parent0f62519cd77f1cf38dee5b58377d0c347fe619bc (diff)
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.
Diffstat (limited to 'table')
-rw-r--r--table/path.go2
1 files changed, 1 insertions, 1 deletions
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))
}