Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't exclusively bind the mDNS broadcast listen port #859

Open
brokeh opened this issue Aug 26, 2023 · 1 comment
Open

Don't exclusively bind the mDNS broadcast listen port #859

brokeh opened this issue Aug 26, 2023 · 1 comment
Labels
✨ feature-request New feature or request

Comments

@brokeh
Copy link

brokeh commented Aug 26, 2023

I'd like to make use of the report-client-info setting to include my internal client hostnames in logs where my pfSense router is the DNS resolver for my network, however, enabling that option exclusively binds to port UDP/5353 for the mDNS listener which then breaks my Avahi mDNS forwarder which wants to bind to the same port.

This should be done by setting the SO_REUSEADDR option before binding to the socket. See https://linux.die.net/man/3/setsockopt#:~:text=a%20Boolean%20option.-,SO_REUSEADDR,-Specifies%20that%20the

I think the relevant place to set this would be the net.ListenMulticastUDP in

if conn, err = net.ListenMulticastUDP("udp4", &iface, ipv4Addr); err == nil {
go r.read(ctx, conn)
conns = append(conns, conn)
}
if conn, err = net.ListenMulticastUDP("udp6", &iface, ipv6Addr); err == nil {
go r.read(ctx, conn)
conns = append(conns, conn)
}
but from what I can tell from the documentation it is not possible to set socket options when using this method.

@brokeh brokeh added the ✨ feature-request New feature or request label Aug 26, 2023
@rs
Copy link
Contributor

rs commented Sep 11, 2023

It does not seem to be easily doable with Go. I'm not sure it would work correctly anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants