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`.
This commit is contained in:
Wade Simmons 2019-12-17 11:46:48 -05:00
parent 2c8b0ec7b1
commit 5350b9ef6f
1 changed files with 1 additions and 1 deletions

View File

@ -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) 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) return nil, fmt.Errorf("unable to bind to socket: %s", err)
} }