net: Listen{,Packet,TCP,UDP,MulticastUDP,IP} can't bind to 255.255.255.255 #28798
Labels
Comments
User error. Issue is broadcast is not the same a multi-cast. |
The syscall bind just books a protocol control block for the argument, and almost all the implementations (especially kernels have SO_BROADCAST-like options) will reject the booking with an IPv4 limited, or directed broadcast address because it connotes some ambiguity on IP packet routing. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version go1.10.4 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/alan/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/alan/go"
GORACE=""
GOROOT="/usr/lib/go-1.10"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build812735178=/tmp/go-build -gno-record-gcc-switches"
What did you do?
repro.go.txt
What did you expect to see?
net.ListenMulticastUDP succeeds
What did you see instead?
2018/11/14 11:44:40 listen udp 255.255.255.255:48899: bind: cannot assign requested address
exit status 1
The text was updated successfully, but these errors were encountered: