Go 1.9 introduced error on UDP Multicast JoinGroup

295 views
Skip to first unread message

Paul Stead

unread,
Aug 27, 2017, 7:14:20 PM8/27/17
to golang-nuts
Hi all,

I upgraded to Go 1.9 and since then UDP multicast code that has been running fine for over a year is now failing on JoinGroup.  I run this program on linux Mint 18 as root (using sudo), both for the multicast permissions and also to allow listening on TCP port 80 and redirecting to port 443 for SSL.  The error returned from JoinGroup is "operation not permitted" which I could expect for a non-privileged user, but not for root.  

If I recompile the program using Go 1.8.3 the exact same works again.

I won't show all the code since there are several structs and "objects" involved, but here's the failing bit, with the interface, listen address, and group address all hard coded just for this example:

iFace := "eno1"
listenAddr := "0.0.0.0:12080"
grpAddress := "224.0.0.12"
inetConn, err3 := net.ListenPacket("udp4", listenAddr)
if err3 != nil {
alertMsg = bsutils.CreateFormattedBSAlert(bsutils.ALERT_CRITICAL, "ListenPacket Failed: %s", err3.Error())
return nil, alertMsg
}

mConn := ipv4.NewPacketConn(inetConn)
if err := mConn.JoinGroup(iFace, &net.UDPAddr{IP: grpAddress}); err != nil {
alertMsg = bsutils.CreateFormattedBSAlert(bsutils.ALERT_CRITICAL, "JoinGroup Failed: %s", err.Error())
return nil, alertMsg
}

If it gets past the above code, I then do a SetControlMessage and return mConn for normal serving.

thanks,
Paul

Pierre Durand

unread,
Aug 27, 2017, 7:28:48 PM8/27/17
to golang-nuts
Did you test Go 1.9 betas or RCs ?

oldCoderException

unread,
Aug 27, 2017, 7:36:22 PM8/27/17
to golang-nuts
No.  I just downloaded and used 1.9 on its release last week.  I've reverted to 1.8.3 for now and, as mentioned, it's working fine for me.

Jason E. Aten

unread,
Aug 27, 2017, 11:44:30 PM8/27/17
to golang-nuts
https://github.com/golang/go/issues

I don't see an existing issue for this. I would file one with details about how to reproduce.

James Bardin

unread,
Aug 28, 2017, 2:37:32 PM8/28/17
to golang-nuts


On Sunday, August 27, 2017 at 7:36:22 PM UTC-4, oldCoderException wrote:
No.  I just downloaded and used 1.9 on its release last week.  I've reverted to 1.8.3 for now and, as mentioned, it's working fine for me.



Are you certain you also have the latest version of golang.org/x/net/ipv4

Paul Stead

unread,
Aug 28, 2017, 3:13:54 PM8/28/17
to James Bardin, golang-nuts
Excellent catch James!  I looked, and it seems my x/net/ipv4 files were all from 2015.  I forced an update of those using go get -u, and things seem good now.  I'll need a way to ensure things get updated more completely going forward I guess.

thank you.
Paul

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/PYT1wJYHEP0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harley Laue

unread,
Aug 28, 2017, 5:03:35 PM8/28/17
to Paul Stead, golang-nuts
Might be a good excuse to try deposit (https://github.com/golang/dep

I think

$ dep ensure -update

Might be roughly what you would have wanted in this case.

To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages