From d68014e6349ba9fdce11a2b23b4fc61d460df6b3 Mon Sep 17 00:00:00 2001
From: Maximilian Wilhelm <max@sdn.clinic>
Date: Sun, 1 Jul 2018 22:00:55 +0200
Subject: [PATCH] Check if trie node previously was a dummy when deciding if
 it's new.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
---
 routingtable/trie.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/routingtable/trie.go b/routingtable/trie.go
index 25a4262e..82caf1ad 100644
--- a/routingtable/trie.go
+++ b/routingtable/trie.go
@@ -118,8 +118,10 @@ func (n *node) addPath(pfx net.Prefix, p *route.Path) (*node, bool) {
 	currentPfx := n.route.Prefix()
 	if currentPfx == pfx {
 		n.route.AddPath(p)
+		// Store previous dummy-ness to check it this node became new
+		dummy := n.dummy
 		n.dummy = false
-		return n, true
+		return n, dummy == true
 	}
 
 	// is pfx NOT a subnet of this node?
-- 
GitLab