Return new copy of interfaces on each Interfaces() call

This commit is contained in:
Neil Alexander 2019-06-29 00:12:56 +01:00
parent 54f1804101
commit 27b3b9b49b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 16 additions and 56 deletions

View file

@ -5,7 +5,7 @@ import "github.com/yggdrasil-network/yggdrasil-go/src/admin"
func (m *Multicast) SetupAdminHandlers(a *admin.AdminSocket) {
a.AddHandler("getMulticastInterfaces", []string{}, func(in admin.Info) (admin.Info, error) {
var intfs []string
for _, v := range m.GetInterfaces() {
for _, v := range m.Interfaces() {
intfs = append(intfs, v.Name)
}
return admin.Info{"multicast_interfaces": intfs}, nil