Fixes #526.
R=r
CC=golang-dev
https://golang.org/cl/186211
// Allow reuse of recently-used addresses.
syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+ // Allow broadcast.
+ syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
+
if la != nil {
e = syscall.Bind(s, la)
if e != 0 {
fd *netFD
}
-func newUDPConn(fd *netFD) *UDPConn {
- c := &UDPConn{fd}
- setsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
- return c
-}
+func newUDPConn(fd *netFD) *UDPConn { return &UDPConn{fd} }
func (c *UDPConn) ok() bool { return c != nil && c.fd != nil }