summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4')
-rw-r--r--dhcpv4/options.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/dhcpv4/options.go b/dhcpv4/options.go
index 68ce665..4968130 100644
--- a/dhcpv4/options.go
+++ b/dhcpv4/options.go
@@ -156,8 +156,10 @@ func (o Options) fromBytesCheckEnd(data []byte, checkEndOption bool) error {
}
// Any bytes left must be padding.
+ var pad uint8
for buf.Len() >= 1 {
- if buf.Read8() != optPad {
+ pad = buf.Read8()
+ if pad != optPad && pad != optEnd {
return ErrInvalidOptions
}
}