diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-10-23 11:21:25 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-10-23 11:21:25 -0400 |
commit | 0cada533358361e760958bae7e9d6fd3f60963b2 (patch) | |
tree | 63e1492d2c1cc07626316603d848e376f64a4c65 | |
parent | cb605f4bd1868c443799f4764e9400ada2c08eb8 (diff) |
fix sending triggeredupdate bug
-rw-r--r-- | pkg/ipstack/ipstack.go | 13 | ||||
-rwxr-xr-x | vhost | bin | 3105056 -> 3095666 bytes | |||
-rwxr-xr-x | vrouter | bin | 3105056 -> 3095666 bytes |
3 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) Binary files differBinary files differ |