Bug 282569 - [NEW PORT] net/mdns-bridge mDNS Bridge
Summary: [NEW PORT] net/mdns-bridge mDNS Bridge
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: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 18:39 UTC by Denny Page
Modified: 2024-11-20 15:39 UTC (History)
4 users (show)

See Also:


Attachments
Patch to add net/mdns-bridge (1.79 KB, application/mbox)
2024-11-05 18:39 UTC, Denny Page
no flags Details
Revised patch that adds init script and sample config (2.98 KB, patch)
2024-11-09 01:25 UTC, Denny Page
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denny Page 2024-11-05 18:39:10 UTC
Created attachment 254971 [details]
Patch to add net/mdns-bridge

mDNS Bridge (mdns-bridge) is a daemon for forwarding mDNS data between network interfaces. It is intended for use by firewalls to provide service discovery across network segments, with and without filtering, for both IPv4 and IPv6.
Comment 1 Renato Botelho freebsd_committer freebsd_triage 2024-11-08 14:27:38 UTC
Denny,

Correct if I'm wrong but my understanding is this port would need an rc script to start/stop this daemon
Comment 2 Renato Botelho freebsd_committer freebsd_triage 2024-11-08 14:31:38 UTC
(In reply to Renato Botelho from comment #1)
Also, it would be nice to install a default configuration file, even it all lines are commented out, but at least to be a reference for users
Comment 3 Denny Page 2024-11-08 15:22:12 UTC
Hi Renato, thank you for taking a look at this.

There is an example config in the upstream distribution "mdns-bridge.conf.example" which could be installed. I don't believe that it should be installed without the ".example" extension, because it cannot be used without correctly setting the interfaces list.

I looked at the doc, and a few other ports, and it was somewhat unclear where "mdns-bridge.conf.example" should be installed. Some suggested EXAMPLESDIR, some suggested DOCSDIR. I would be grateful if you would make a recommendation, or go ahead and add whatever you think appropriate to the Makefile that's been submitted.

Regarding rc scripts, these are very system dependent so I have shied away from them. In pfSense, which is my target for the FreeBSD version, packages usually ignore any rc scripts in the distribution, and write their own on save. The package that I am working on for mdns-bridge does this as well. Since an rc script is unlikely to ever be used, I didn't put one it. If you think it critical, please let me know.

Thanks, Denny
Comment 4 Renato Botelho freebsd_committer freebsd_triage 2024-11-08 17:47:57 UTC
(In reply to Denny Page from comment #3)
Usually on ports tree we install configuration files in the place they should be read by default when service is started.  In this case I believe it could be /usr/local/etc/mdns-bridge.conf.  I took a look at the example present at repository and you can use it if you don't want to make one specific for the ports.

You can use the @sample facility on pkg-plist that will make config file to be installed with .sample suffix and will respect when user modifies the .conf file and it differs from .sample.

Regarding the rc script, since you are adding the port on FreeBSD, you should think with the FreeBSD ports in mind and on FreeBSD ports, when you add a daemon, you add an rc script that helps user to enable/start/stop/restart the service.  You can find more information about it at [1].  If you have further questions just let me know.

[1] https://docs.freebsd.org/en/books/porters-handbook/special/#rc-scripts
Comment 5 Denny Page 2024-11-09 01:25:57 UTC
Created attachment 255042 [details]
Revised patch that adds init script and sample config
Comment 6 Denny Page 2024-11-09 01:26:41 UTC
(In reply to Renato Botelho from comment #4)

Hi Renato,

I've added a new attachment that includes the init file and the same config file. Please review and let me know what you think.

Thanks,
Denny
Comment 7 Denny Page 2024-11-09 06:27:55 UTC
(In reply to Denny Page from comment #6)

Sorry, that should have been _sample_ config file.
Comment 8 Denny Page 2024-11-15 01:36:43 UTC
(In reply to Renato Botelho from comment #4)

Renato, with the init file and the sample config added, does it look acceptable? Is there anything else I need to do? Thanks, Denny
Comment 9 Renato Botelho freebsd_committer freebsd_triage 2024-11-18 12:23:28 UTC
(In reply to Denny Page from comment #8)
Hello Denny!  I was out on vacation, returning today.  I'll take a look at it later.

Thanks!
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-11-20 11:25:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bb1dea909cdd856bbb42c42cddf52fc751edec4c

commit bb1dea909cdd856bbb42c42cddf52fc751edec4c
Author:     Denny Page <dennypage@me.com>
AuthorDate: 2024-11-20 11:22:37 +0000
Commit:     Renato Botelho <garga@FreeBSD.org>
CommitDate: 2024-11-20 11:24:10 +0000

    net/mdns-bridge: New port

    daemon for forwarding mDNS data between network interfaces. It
    is intended for use by firewalls to provide service discovery
    across network segments, with and without filtering, for both
    IPv4 and IPv6.

    PR:             282569
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

 net/Makefile                               |  1 +
 net/mdns-bridge/Makefile (new)             | 21 +++++++++++++++++++++
 net/mdns-bridge/distinfo (new)             |  3 +++
 net/mdns-bridge/files/mdns_bridge.in (new) | 30 ++++++++++++++++++++++++++++++
 net/mdns-bridge/pkg-descr (new)            |  4 ++++
 net/mdns-bridge/pkg-plist (new)            |  2 ++
 6 files changed, 61 insertions(+)
Comment 11 Denny Page 2024-11-20 15:39:09 UTC
Thank you Renato