diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-09-16 13:15:11 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-09-16 13:54:11 +0900 |
commit | d026fabfea3f529fd6148cb487e24dab48a73081 (patch) | |
tree | ce46f262831fc833e372ceed084b422ece72806f /table/path.go | |
parent | 2cfc7d972006e77a6c47fe1f2becbadd3c67bedd (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.go | 4 |
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) } |