Adguardhome/internal/aghnet/interfaces_linux.go
Ainar Garipov b0e930c6bc Pull request 2742: ADG-12585-modernize
Squashed commit of the following:

commit 4b963c0a66cb845ec44bf21e50f39f57b1260427
Author: Ainar Garipov <a.garipov@adguard.com>
Date:   Tue Aug 4 18:17:38 2026 +0300

    all: modernize; rm unused params; upd docs
2026-08-04 15:35:08 +00:00

23 lines
591 B
Go

//go:build linux
package aghnet
import (
"net"
"github.com/AdguardTeam/golibs/netutil"
"github.com/insomniacslk/dhcp/dhcpv4/nclient4"
)
// listenPacketReusable announces on the local network address additionally
// configuring the socket to have a reusable binding.
func listenPacketReusable(ifaceName, _, address string) (c net.PacketConn, err error) {
var port uint16
_, port, err = netutil.SplitHostPort(address)
if err != nil {
return nil, err
}
// TODO(e.burkov): Inspect nclient4.NewRawUDPConn and implement here.
return nclient4.NewRawUDPConn(ifaceName, int(port))
}