From 8dfa75434e4976cedae6989601b28da3f7c93e9a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 18 Jun 2016 16:44:06 -0700 Subject: [PATCH] dhcp4: allow duplication of option 56 (Debug message). Turns out real DHCP servers can duplicate this message. --- dhcp4/options.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dhcp4/options.go b/dhcp4/options.go index 5ac2fa6..a832303 100644 --- a/dhcp4/options.go +++ b/dhcp4/options.go @@ -93,7 +93,10 @@ func (o Options) Unmarshal(bs []byte) error { // is going to be an error, until I get a bug report about // something that actually does it. if _, ok := o[opt]; ok { - return fmt.Errorf("packet has duplicate option %d (please file a bug with a pcap!)", opt) + // Okay fine option 56 can be duped. + if opt != 56 { + return fmt.Errorf("packet has duplicate option %d (please file a bug with a pcap!)", opt) + } } if len(bs) < 2 { return fmt.Errorf("option %d has no length byte", opt)