[Bug 208652] [PATCH] net/mdns-repeater: bind to proper interface; strerror

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Apr 9 11:57:59 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208652

            Bug ID: 208652
           Summary: [PATCH] net/mdns-repeater: bind to proper interface;
                    strerror
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ehaupt at FreeBSD.org
          Reporter: johan at stromnet.se
 Attachment #169123 maintainer-approval?
             Flags:
          Assignee: ehaupt at FreeBSD.org
          Keywords: patch
             Flags: maintainer-feedback?(ehaupt at FreeBSD.org)

Created attachment 169123
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=169123&action=edit
Patch to fix interface binding & error messages on FreeBSD.

The net/mdns-repeater port is supposed to read one mDNS multicast packet from
one interface, and forward it to one or more interfaces.

On FreeBSD it does not properly bind each sending socket to their corresponding
interface, instead it just sends to multi-cast IP 244.0.0.251, which is emitted
on the interface found via the default route (at least that was the case here).
In my case this was my internet interface, resulting in all packets getting
blocked by my firewall (and not sent at all to the proper interfaces).
Not sure if this have ever worked on a multi-homed machine, but perhaps all the
users have wanted it to forward to the interface with the default route, and
assumed it was fine.

The existing code solves this with the Linux-specific SO_BINDTODEVICE opt, if
it exists. It doesn't on FreeBSD.
The attached patch fixes this by using the IP_MULTICAST_IF socket option
instead.

The patch also replaces the use of GNU-specific %m formatter (expands to
strerror(errno)). While this works on FreeBSD syslog(3), it does not work on
FreeBSD printf(3).

Patch built with make makepatch.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list