From fedfc3a1fd4e4592579f73b1126d532a2070e01a Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Sat, 29 Dec 2018 16:40:38 +0300 Subject: [PATCH] Update comment why filter_conn.go is needed. --- dhcpd/filter_conn.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dhcpd/filter_conn.go b/dhcpd/filter_conn.go index cd943ab1..ec34c795 100644 --- a/dhcpd/filter_conn.go +++ b/dhcpd/filter_conn.go @@ -7,13 +7,15 @@ import ( "golang.org/x/net/ipv4" ) +// filterConn listens to 0.0.0.0:67, but accepts packets only from specific interface +// This is neccessary for DHCP daemon to work, since binding to IP address doesn't +// us access to see Discover/Request packets from clients. +// // TODO: on windows, controlmessage does not work, try to find out another way // https://github.com/golang/net/blob/master/ipv4/payload.go#L13 - type filterConn struct { iface net.Interface conn *ipv4.PacketConn - // cm *ipv4.ControlMessage } func newFilterConn(iface net.Interface, address string) (*filterConn, error) {