From 365548a29f23f15632305d65070236cfd270589c Mon Sep 17 00:00:00 2001 From: sotech117 Date: Mon, 9 Oct 2023 12:53:12 -0400 Subject: fix small bug --- pkg/ipstack/ipstack.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkg/ipstack/ipstack.go') diff --git a/pkg/ipstack/ipstack.go b/pkg/ipstack/ipstack.go index 7b67d08..c993a7d 100644 --- a/pkg/ipstack/ipstack.go +++ b/pkg/ipstack/ipstack.go @@ -132,7 +132,7 @@ func Initialize(lnxFilePath string) error { if err != nil { return errors.WithMessage(err, "Error creating UDP socket for neighbor->\t"+neighbor.DestAddr.String()) } - go InterfaceListenerRoutine(n.SendSocket, n.SocketChannel) + // go InterfaceListenerRoutine(n.SendSocket, n.SocketChannel) myNeighbors[neighbor.InterfaceName] = append(myNeighbors[neighbor.InterfaceName], n) @@ -180,8 +180,8 @@ func InterfaceListenerRoutine(socket net.UDPConn, signal <-chan bool) { for { select { - case open, sig := <-signal: - if !open { + case sig, ok := <-signal: + if !ok { fmt.Println("channel closed, exiting") closed = true return @@ -189,6 +189,7 @@ func InterfaceListenerRoutine(socket net.UDPConn, signal <-chan bool) { fmt.Println("received isUP SIGNAL with value", sig) isUp = sig default: + continue } } } -- cgit v1.2.3-70-g09d2