AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
25.18k stars 1.81k forks source link

Checking for another DHCP server doesn't work properly on OpenBSD #3441

Open EugeneOne1 opened 3 years ago

EugeneOne1 commented 3 years ago

In #3225 we've added an incomplete support for DHCP on OpenBSD. Checking for other DHCP servers in the network still doesn't work properly in some circumstances.

It seems that net.ListenPacket binds to the unspecified IP address with the specified port and ignores packets that were read by any other listener of the same port. Setting socket options SO_REUSEPORT and SO_REUSEADDR also didn't help.

Perhaps, we may peek some implementation details in github.com/insomniacslk/dhcp/dhcpv4/nclient4.

EugeneOne1 commented 2 years ago

After a bit of investigating, the problem seems to require more sofisticated raw socket manipulation. As a workaround, we may recommend disabling the competing processes (e.g. dhclient, dhcpd, etc) manually on OpenBSD. We'll consider adding this to the documentation until a better solution appears.