diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-05-17 01:26:43 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-05-26 23:19:04 +0900 |
commit | 70434c96d21adef5b71041297009e60e89c91b45 (patch) | |
tree | ddc6a0cd3591284aa518b63ed008ec3b38176f3e /server | |
parent | 1e47e4f6674b8156fed6efa602166d155c7734f7 (diff) |
policy: add support setting self ip address as next-hop
from configuration file
[policy-definitions.statements.actions.bgp-actions]
set-next-hop = "self"
from cli
$ gobgp policy statement stmt1 add action next-hop self
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/peer.go | 2 | ||||
-rw-r--r-- | server/server.go | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/server/peer.go b/server/peer.go index 1baee6cb..966f77d3 100644 --- a/server/peer.go +++ b/server/peer.go @@ -157,7 +157,7 @@ func (peer *Peer) filterpath(path *table.Path) *table.Path { path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf) } options := &table.PolicyOptions{ - Neighbor: peer.fsm.peerInfo.Address, + Info: peer.fsm.peerInfo, } path = peer.policy.ApplyPolicy(peer.TableID(), table.POLICY_DIRECTION_EXPORT, path, options) diff --git a/server/server.go b/server/server.go index 25153aaa..7c9a89e8 100644 --- a/server/server.go +++ b/server/server.go @@ -761,6 +761,7 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) []*SenderMsg { // update for export policy laddr, _ := peer.fsm.LocalHostPort() peer.fsm.pConf.Transport.State.LocalAddress = laddr + peer.fsm.peerInfo.LocalAddress = net.ParseIP(laddr) deferralExpiredFunc := func(family bgp.RouteFamily) func() { return func() { req := NewGrpcRequest(REQ_DEFERRAL_TIMER_EXPIRED, peer.ID(), family, nil) |