Created attachment 178258 [details]
disable SO_REUSEADDR for FreeBSD and enable SO_REUSEPORT instead
I have a dual-homed machine which advertises mDNS resources to only one network. After running the mdnsd in debug mode I discovered that it reports "bind: address already in use" when trying to bind to the second interface.
It appears that on FreeBSD using SO_REUSEADDR is not enough and one needs to use SO_REUSEPORT to successfully receive unicast and multicast packets on the same port on multiple interfaces.
Suggested patch was made against latest Apple upstream version "mDNSResponder-765.20.4"
A commit references this bug:
Date: Fri Apr 28 20:24:29 UTC 2017
New revision: 439627
Use SO_REUSEPORT instead of SO_REUSEADDR
- Bump PORTREVISION for package change
Submitted by: Kirill Pertsev <email@example.com>