Bug 215545 - net/mDNSResponder mdnsd doesn't bind to second interface
Summary: net/mDNSResponder mdnsd doesn't bind to second interface
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-25 14:07 UTC by Kirill Pertsev
Modified: 2017-04-28 20:30 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
disable SO_REUSEADDR for FreeBSD and enable SO_REUSEPORT instead (837 bytes, text/plain)
2016-12-25 14:07 UTC, Kirill Pertsev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kirill Pertsev 2016-12-25 14:07:45 UTC
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"
Comment 1 commit-hook freebsd_committer 2017-04-28 20:25:11 UTC
A commit references this bug:

Author: sunpoet
Date: Fri Apr 28 20:24:29 UTC 2017
New revision: 439627
URL: https://svnweb.freebsd.org/changeset/ports/439627

Log:
  Use SO_REUSEPORT instead of SO_REUSEADDR

  - Bump PORTREVISION for package change

  PR:		215545
  Submitted by:	Kirill Pertsev <kika@kikap.com>

Changes:
  head/net/mDNSResponder/Makefile
  head/net/mDNSResponder/files/patch-mDNSPosix-mDNSPosix.c
Comment 2 Po-Chuan Hsieh freebsd_committer 2017-04-28 20:30:54 UTC
Committed. Thanks!