summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv4/nclient4/conn_unix.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/dhcpv4/nclient4/conn_unix.go b/dhcpv4/nclient4/conn_unix.go
index 67ac94c..239d007 100644
--- a/dhcpv4/nclient4/conn_unix.go
+++ b/dhcpv4/nclient4/conn_unix.go
@@ -113,8 +113,10 @@ func (upc *BroadcastRawUDPConn) ReadFrom(b []byte) (int, net.Addr, error) {
ipHdr = ipv4(buf.Consume(int(headerLength)))
- if headerLength <= protocol || ipHdr.transportProtocol() != udpProtocolNumber {
- continue
+ if headerLength > protocol {
+ if ipHdr.transportProtocol() != udpProtocolNumber {
+ continue
+ }
}
if !buf.Has(udpHdrLen) {