aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ipstack/ipstack.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/pkg/ipstack/ipstack.go b/pkg/ipstack/ipstack.go
index 4556f0f..ddb5b91 100644
--- a/pkg/ipstack/ipstack.go
+++ b/pkg/ipstack/ipstack.go
@@ -879,18 +879,11 @@ func handleRIP(src *Interface, dest *Neighbor, message []byte, hdr *ipv4header.I
timeoutTable[hdr.Src] = 0
mu.Unlock()
}
- continue
+ } else {
+ routingTable[destination] = Hop{entry.cost + 1, "R", src, hdr.Src}
+ triggeredEntries = append(triggeredEntries, RIPEntry{destination, entry.cost + 1})
}
- // fmt.Println("Adding new route to routing table: ", destination.String(), entry.cost)
- // @ david, where did the 17 come from
- //if entry.cost == 17 {
- // routingTable[destination] = Hop{0, "R", src, hdr.Src}
- //} else {
- routingTable[destination] = Hop{entry.cost + 1, "R", src, hdr.Src}
- triggeredEntries = append(triggeredEntries, RIPEntry{destination, entry.cost + 1})
- // }
-
// send out triggered updates
if len(triggeredEntries) > 0 {
sendTriggeredUpdates(triggeredEntries)