hashicorp / hashicorp/mdns

osx - Failed to bind to udp6 port: listen udp6 ff02::fb: setsockopt: can't assign requested address

Open
#35 9 comments 6 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
225
Avg merge
15h 34m
Merged PRs (30d)
3

Description

Getting this error when trying to use Lookup/Query - OSX 10.9.4 Go 1.4.2

Specifically this test - TestServer_Lookup

```
➜ mdns git:(master) go test -run Lookup
2015/04/23 17:03:29 [ERR] mdns: Failed to bind to udp6 port: listen udp6 ff02::fb: setsockopt: can't assign requested address
2015/04/23 17:03:29 [INFO] mdns: Closing client {0xc20802c068 0xc20802c070 0xc20802c078 true 0xc208030360 {1 0}}
2015/04/23 17:03:29 [ERR] mdns: Failed to read packet: read udp4: use of closed network connection
2015/04/23 17:03:29 [ERR] mdns: Failed to read packet: read udp6: use of closed network connection
2015/04/23 17:03:29 [ERR] mdns: Failed to read packet: read udp4: use of closed network connection
PASS
ok github.com/hashicorp/mdns 0.121s
```

Also this simple program failed to run.

``` go
package main

import (
"fmt"
"time"

"github.com/hashicorp/mdns"
)

func main() {

// Make a channel for results and start listening
entriesCh := make(chan *mdns.ServiceEntry, 4)
go func() {
for entry := range entriesCh {
fmt.Printf("Got new entry: %v\n", entry)
}
}()

// Start the lookup
//mdns.Lookup("_googlecast._tcp.local.", entriesCh)

params := mdns.DefaultParams("_googlecast._tcp.local.")

params.Entries = make(chan *mdns.ServiceEntry, 4)

mdns.Query(params)

time.Sleep(10 * time.Second)

close(entriesCh)

}
```

```
➜ mDNSLocal go run client.go
2015/04/23 16:37:55 [ERR] mdns: Failed to bind to udp6 port: listen udp6 ff02::fb: setsockopt: can't assign requested address
2015/04/23 16:37:56 [INFO] mdns: Closing client {0xc208038020 0xc208038028 0xc208038030 true 0xc2080520c0 {1 0}}
2015/04/23 16:37:56 [ERR] mdns: Failed to read packet: read udp4: use of closed network connection
2015/04/23 16:37:56 [ERR] mdns: Failed to read packet: read udp6: use of closed network connection
2015/04/23 16:37:56 [ERR] mdns: Failed to read packet: read udp4: use of closed network connection
```

Having read some other issues, I've checked that the OSX firewall is not on. Also it looks like I have an IPv6 address.

```
➜ mdns git:(master) ifconfig
lo0: flags=8049 mtu 16384
options=3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1
gif0: flags=8010 mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863 mtu 1500
options=10b
ether 40:6c:8f:1c:3f:72
inet6 fe80::426c:8fff:fe1c:3f72%en0 prefixlen 64 scopeid 0x4
inet 192.168.1.110 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=1
media: autoselect (100baseTX )
status: active
fw0: flags=8863 mtu 4078
lladdr 40:6c:8f:ff:fe:5d:de:be
nd6 options=1
media: autoselect
status: inactive
en1: flags=8823 mtu 1500
ether 70:73:cb:c2:cd:ab
nd6 options=1
media: autoselect ()
status: inactive
en4: flags=8963 mtu 1500
options=60
ether b2:00:15:dd:eb:e1
media: autoselect
status: inactive
p2p0: flags=8802 mtu 2304
ether 02:73:cb:c2:cd:ab
media: autoselect
status: inactive
bridge0: flags=8863 mtu 1500
options=63
ether 42:6c:8f:c1:81:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en4 flags=3
ifmaxaddr 0 port 7 priority 0 path cost 0
nd6 options=1
media:
status: inactive
```

Any pointers about what I should be looking at? Tried to do it using sudo but same result.
Slightly confused as the tests run and are ok - are the above messages errors?

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.