golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
121.32k stars 17.38k forks source link

net: implement multicast network interface API on OpenBSD #9669

Open mikioh opened 9 years ago

mikioh commented 9 years ago

See https://github.com/golang/go/blob/master/src/net/interface_openbsd.go.

mdempsky commented 9 years ago

Unfortunately, I don't think this is possible to do currently on OpenBSD. The list of multicast addresses is stored in each interface's struct ifnet's if_maddrlist field, but the only references to this are for adding/removing multicast addresses. There are no system calls for retrieving the active list of multicast addresses.

I suspect the most appropriate solution would be to mimic SIOCGIFCONF, the ioctl used for retrieving the list of unicast addresses on an interface. It probably wouldn't be difficult to implement if someone has the time/motivation to look into it.

mikioh commented 9 years ago

ifnet's if_maddrlist field

yup.

no system calls

yup, hope openbsd guys have a plan.

SIOCGIFCONF

or, reconstructing per-interface multicast address lists by using routing entries, as a compromise until they provide system calls. once https://go-review.googlesource.com/#/c/4330/ lands, perhaps it might not be so tough.

mdempsky commented 9 years ago

yup, hope openbsd guys have a plan.

Well, I'm an OpenBSD developer... just not a very active one lately. :(

I doubt any OpenBSD developers have a plan for this currently, but that doesn't mean it can't be fixed if someone wants to propose an API and/or write a patch.

reconstructing per-interface multicast address lists by using routing entries

Hm, that might work. I haven't used multicast on OpenBSD in a while though, so I'd have to play around with it.