Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: UDP Multicast support broken #2730

Closed
gopherbot opened this issue Jan 18, 2012 · 6 comments

Comments

Projects
None yet
3 participants
@gopherbot
Copy link

commented Jan 18, 2012

by Paul.A.Lalonde:

As discussed with Mikio and Devon here's an issue filed.
What steps will reproduce the problem?
This program panics with "listen udp4 0.0.0.0:18081: address already in use":
package main

import "net"

func main() {
    mcaddr, err := net.ResolveUDPAddr("udp4", "224.33.44.135:18081")
    if err != nil {
        panic(err)
    }
    c, err := net.ListenUDP("udp4", &net.UDPAddr{
        IP:   net.IPv4zero,
        Port: mcaddr.Port,
    })
    if err != nil {
        panic(err)
    }
}

What is the expected output?
None

What do you see instead?
panic: listen udp4 0.0.0.0:18081: address already in use

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Ubuntu 10.04

Which revision are you using?  (hg identify)
8c0e39009d5e tip

Please provide any additional information below.
Works in weekly.2011-12-22
@mikioh

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2012

Comment 1:

Can you try to run "gotest -v -multicast -file multicast_test.go" at src/pkg/net on
Ubuntu 10.04?
@mikioh

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2012

Comment 2:

Labels changed: added priority-go1, removed priority-triage.

Owner changed to @mikioh.

@gopherbot

This comment has been minimized.

Copy link
Author

commented Jan 18, 2012

Comment 3 by Paul.A.Lalonde:

The test passes:
plalonde@plalonde-desktop:~/go.tip/src/pkg/net$ gotest -v multicast -file multi
cast_test.go
rm -f _test/net.a
CGOPKGPATH= cgo --  cgo_linux.go cgo_unix.go
touch _obj/_cgo_run
6g   -p net -o _gotest_.6 dial.go dnsclient.go dnsmsg.go doc.go hosts.go interfa
ce.go ip.go iprawsock.go ipsock.go net.go parse.go pipe.go tcpsock.go udpsock.go
 unixsock.go  dnsclient_unix.go dnsconfig.go fd.go fd_linux.go file.go interface
_linux.go iprawsock_posix.go ipsock_posix.go lookup_unix.go newpollserver.go por
t.go sendfile_linux.go sock.go sock_linux.go sockopt.go sockopt_linux.go sockopt
ip.go sockoptip_linux.go tcpsock_posix.go udpsock_posix.go unixsock_posix.go  _o
bj/cgo_linux.cgo1.go _obj/cgo_unix.cgo1.go _obj/_cgo_gotypes.go multicast_test.g
o
6c -FVw -I/home/plalonde/go.tip/pkg/linux_amd64 -I . -o "_cgo_defun.6" _obj/_cgo
_defun.c
gcc -m64 -I . -g -fPIC -O2 -o _cgo_main.o -c -I_obj   _obj/_cgo_main.c
gcc -m64 -I . -g -fPIC -O2 -o cgo_linux.cgo2.o -c -I_obj   _obj/cgo_linux.cgo2.c
gcc -m64 -I . -g -fPIC -O2 -o cgo_unix.cgo2.o -c -I_obj   _obj/cgo_unix.cgo2.c
gcc -m64 -I . -g -fPIC -O2 -o _cgo_export.o -c -I_obj   _obj/_cgo_export.c
gcc -m64 -g -fPIC -O2 -o _cgo1_.o _cgo_main.o cgo_linux.cgo2.o cgo_unix.cgo2.o _
cgo_export.o
cgo -dynimport _cgo1_.o >_obj/_cgo_import.c_ && mv -f _obj/_cgo_import.c_ _obj/_
cgo_import.c
6c -FVw -I . -o "_cgo_import.6" _obj/_cgo_import.c
rm -f _test/net.a
gopack grc _test/net.a _gotest_.6  _cgo_defun.6 _cgo_import.6 cgo_linux.cgo2.o c
go_unix.cgo2.o _cgo_export.o
=== RUN net.TestMulticastUDP
--- PASS: net.TestMulticastUDP (0.00 seconds)
        cgo_linux.cgo1.go:236: test disabled; use --multicast to enable
=== RUN net.TestSimpleMulticastUDP
--- PASS: net.TestSimpleMulticastUDP (0.00 seconds)
        cgo_linux.cgo1.go:299: test disabled; use --multicast to enable
PASS
@gopherbot

This comment has been minimized.

Copy link
Author

commented Jan 18, 2012

Comment 4 by Paul.A.Lalonde:

I managed to mess up the command line; here is the correct command line and output
plalonde@plalonde-desktop:~/go.tip/src/pkg/net$ gotest -v -multicast -file mult
icast_test.go
rm -f _test/net.a
rm -f _test/net.a
gopack grc _test/net.a _gotest_.6  _cgo_defun.6 _cgo_import.6 cgo_linux.cgo2.o c
go_unix.cgo2.o _cgo_export.o
=== RUN net.TestMulticastUDP
--- PASS: net.TestMulticastUDP (0.00 seconds)
        cgo_linux.cgo1.go:343: IPv4 multicast interface: <nil>
        cgo_linux.cgo1.go:353: IPv4 multicast TTL: 1
        cgo_linux.cgo1.go:363: IPv4 multicast loopback: true
        cgo_linux.cgo1.go:343: IPv4 multicast interface: <nil>
        cgo_linux.cgo1.go:353: IPv4 multicast TTL: 1
        cgo_linux.cgo1.go:363: IPv4 multicast loopback: true
        cgo_linux.cgo1.go:343: IPv4 multicast interface: <nil>
        cgo_linux.cgo1.go:353: IPv4 multicast TTL: 1
        cgo_linux.cgo1.go:363: IPv4 multicast loopback: true
=== RUN net.TestSimpleMulticastUDP
--- PASS: net.TestSimpleMulticastUDP (0.00 seconds)
PASS
plalonde@plalonde-desktop:~/go.tip/src/pkg/net$
@rsc

This comment has been minimized.

Copy link
Contributor

commented Jan 24, 2012

Comment 5:

Status changed to Accepted.

@mikioh

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2012

Comment 6:

This issue was closed by revision 2f63afd.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015

@rsc rsc removed the priority-go1 label Apr 10, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.