aboutsummaryrefslogtreecommitdiff
path: root/cmd/vhost/main.go
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-10-22 09:32:06 -0400
committersotech117 <michael_foiani@brown.edu>2023-10-22 09:32:06 -0400
commite333100499904a35126dd70eea58802ed9761435 (patch)
tree2733d58de1f086fa08dde87fe30b597d5f747376 /cmd/vhost/main.go
parent0e9b4d3c70b0244299706da0992ca0306ce033de (diff)
fix multiple send bug
Diffstat (limited to 'cmd/vhost/main.go')
-rw-r--r--cmd/vhost/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/vhost/main.go b/cmd/vhost/main.go
index f3bf6ab..549b1de 100644
--- a/cmd/vhost/main.go
+++ b/cmd/vhost/main.go
@@ -60,9 +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 == hop.VIP ||
- neighbor.VipAddr == netip.MustParseAddr(ipAddr) ||
- hop.Type == "S" {
+ // TODO: fix multiple send bug here on static route
+ if neighbor.VipAddr == netip.MustParseAddr(ipAddr) ||
+ neighbor.VipAddr == hop.VIP && hop.Type == "S" {
err = ipstack.SendIP(&myAddr, neighbor, ipstack.TEST_PROTOCOL, messageToSendBytes, ipAddr, nil)
if err != nil {
fmt.Println(err)