mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-26 23:28:08 +03:00
c5ed6da5bd
Before this patch we couldn't receive incoming DHCP packets. Now we bind() to 0.0.0.0 and set the required network interface using SO_BINDTODEVICE option. As an improvement, we now wait until a reply to our request is received and skip all unknown packets.
12 lines
228 B
Go
12 lines
228 B
Go
package dhcpd
|
|
|
|
import (
|
|
"net"
|
|
|
|
"golang.org/x/net/ipv4"
|
|
)
|
|
|
|
// Create a socket for receiving broadcast packets
|
|
func newBroadcastPacketConn(bindAddr net.IP, port int, ifname string) (*ipv4.PacketConn, error) {
|
|
return nil, nil
|
|
}
|