summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-09-16 13:15:11 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-09-16 13:54:11 +0900
commitd026fabfea3f529fd6148cb487e24dab48a73081 (patch)
treece46f262831fc833e372ceed084b422ece72806f /table/path.go
parent2cfc7d972006e77a6c47fe1f2becbadd3c67bedd (diff)
table: use explicitly specified nexthop for iBGP if exists
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r--table/path.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/table/path.go b/table/path.go
index 22a068eb..123b8a0c 100644
--- a/table/path.go
+++ b/table/path.go
@@ -96,8 +96,8 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
// if the path generated locally set local address as nexthop.
// if not, don't modify it.
// TODO: NEXT-HOP-SELF support
- selfGenerated := path.GetSource().ID == nil
- if selfGenerated {
+ nexthop := path.GetNexthop()
+ if path.IsLocal() && (nexthop.Equal(net.ParseIP("0.0.0.0")) || nexthop.Equal(net.ParseIP("::"))) {
path.SetNexthop(localAddress)
}