summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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)
}