From d026fabfea3f529fd6148cb487e24dab48a73081 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 16 Sep 2015 13:15:11 +0900 Subject: table: use explicitly specified nexthop for iBGP if exists Signed-off-by: ISHIDA Wataru --- table/path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'table/path.go') 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) } -- cgit v1.2.3