summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-25 02:43:31 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-25 02:53:42 +0000
commit0dbf1d87cb6f42498e6607d616572fb80d36fd83 (patch)
treea942f671dd44ee75480ad6d3f162d9d29f1be42d /table/path.go
parent7c42e295e28c233fdb7a130681cd490308f116ca (diff)
policy: add local-pref action
$ gobgp policy statement st01 add action local-pref 110 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r--table/path.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/table/path.go b/table/path.go
index a4fc4e43..eefc2780 100644
--- a/table/path.go
+++ b/table/path.go
@@ -180,11 +180,6 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
path.delPathAttr(bgp.BGP_ATTR_TYPE_MULTI_EXIT_DISC)
}
- // remove local-pref attribute
- if pref := path.getPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF); pref != nil && !config.IsConfederationMember(global, peer) {
- path.delPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF)
- }
-
} else if peer.Config.PeerType == config.PEER_TYPE_INTERNAL {
// NEXTHOP handling for iBGP
// if the path generated locally set local address as nexthop.
@@ -812,6 +807,12 @@ func (path *Path) SetMed(med int64, doReplace bool) error {
return nil
}
+func (path *Path) RemoveLocalPref() {
+ if path.getPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF) != nil {
+ path.delPathAttr(bgp.BGP_ATTR_TYPE_LOCAL_PREF)
+ }
+}
+
func (path *Path) GetOriginatorID() net.IP {
if attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_ORIGINATOR_ID); attr != nil {
return attr.(*bgp.PathAttributeOriginatorId).Value