diff options
Diffstat (limited to 'dhcpv4/nclient4/conn_unix.go')
-rw-r--r-- | dhcpv4/nclient4/conn_unix.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/dhcpv4/nclient4/conn_unix.go b/dhcpv4/nclient4/conn_unix.go index 7f79f50..1495dc2 100644 --- a/dhcpv4/nclient4/conn_unix.go +++ b/dhcpv4/nclient4/conn_unix.go @@ -99,14 +99,9 @@ func (upc *BroadcastRawUDPConn) ReadFrom(b []byte) (int, net.Addr, error) { pkt = pkt[:n] buf := uio.NewBigEndianBuffer(pkt) - // To read the header length, access data directly. - if !buf.Has(ipv4MinimumSize) { - continue - } - ipHdr := ipv4(buf.Data()) - if !buf.Has(int(ipHdr.headerLength())) { + if !ipHdr.isValid(n) { continue } |