From 5350b9ef6fa6e5c88a5fb6aeb53e61dd0ac77f0f Mon Sep 17 00:00:00 2001 From: Wade Simmons Date: Tue, 17 Dec 2019 11:46:48 -0500 Subject: [PATCH] fix listen.host We were parsing listen.host, but not actually using it in the `bind` call, so we were always binding to `0.0.0.0`. --- udp_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udp_linux.go b/udp_linux.go index a9ba64c..c810cc2 100644 --- a/udp_linux.go +++ b/udp_linux.go @@ -73,7 +73,7 @@ func NewListener(ip string, port int, multi bool) (*udpConn, error) { return nil, fmt.Errorf("unable to set SO_REUSEPORT: %s", err) } - if err = unix.Bind(fd, &unix.SockaddrInet4{Port: port}); err != nil { + if err = unix.Bind(fd, &unix.SockaddrInet4{Addr: lip, Port: port}); err != nil { return nil, fmt.Errorf("unable to bind to socket: %s", err) }