diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-10-22 09:22:31 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-10-22 09:22:31 -0400 |
commit | 36b61f5f38bd2aae78353fa112c0787f0a89a31f (patch) | |
tree | 5ff772aeacbe6f3caf54cd8685a9ee8b19c4d0cb /cmd/vhost/main.go | |
parent | a935739d332ccb82174ddb925dcf5e473dfae41f (diff) |
forwarding works as expected among multiple subnets, but checksum fails. will focus more on RIP timeouts next.
Diffstat (limited to 'cmd/vhost/main.go')
-rw-r--r-- | cmd/vhost/main.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/vhost/main.go b/cmd/vhost/main.go index 4684c2f..f3bf6ab 100644 --- a/cmd/vhost/main.go +++ b/cmd/vhost/main.go @@ -60,7 +60,9 @@ func main() { hop, err := ipstack.LongestPrefix(netip.MustParseAddr(ipAddr)) myAddr := hop.Interface.IpPrefix.Addr() for _, neighbor := range ipstack.GetNeighbors()[hop.Interface.Name] { - if neighbor.VipAddr == netip.MustParseAddr(ipAddr) { + if neighbor.VipAddr == hop.VIP || + neighbor.VipAddr == netip.MustParseAddr(ipAddr) || + hop.Type == "S" { err = ipstack.SendIP(&myAddr, neighbor, ipstack.TEST_PROTOCOL, messageToSendBytes, ipAddr, nil) if err != nil { fmt.Println(err) |