mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-10-21 03:03:08 +00:00
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
23 lines
591 B
Go
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))
|
|
}
|