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.
13 lines
228 B
Go
13 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
|
|
}
|