Browse Source

Merge pull request #106 from slackhq/fix-listen-host

fix listen.host
Wade Simmons 5 years ago
parent
commit
0d1da7579e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      udp_linux.go

+ 1 - 1
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)
 		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)
 	}
 	}