diff options
author | Hariharakumar Narasimhakumar <hana8349@colorado.edu> | 2021-08-27 10:34:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 18:34:40 +0100 |
commit | b95caade3eac806fa0f09a38d2ca991cf449b7b3 (patch) | |
tree | 815ea6a9a44b53531f5b67cf5c849da74c36a622 /dhcpv4/ztpv4/ztp.go | |
parent | 9bb7354278c1ab7d4ec1addf82ddb236a8857798 (diff) |
[ztpv4][cisco firepower] Check to ensure serial number in Opt 61 is not empty (#444)
* Adding check for empty serial number in opt 61
Diffstat (limited to 'dhcpv4/ztpv4/ztp.go')
-rw-r--r-- | dhcpv4/ztpv4/ztp.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dhcpv4/ztpv4/ztp.go b/dhcpv4/ztpv4/ztp.go index 09ec790..ef8e13d 100644 --- a/dhcpv4/ztpv4/ztp.go +++ b/dhcpv4/ztpv4/ztp.go @@ -72,6 +72,9 @@ func parseClassIdentifier(packet *dhcpv4.DHCPv4) (*VendorData, error) { vd.VendorName = iana.EntIDCiscoSystems.String() vd.Model = vc vd.Serial = dhcpv4.GetString(dhcpv4.OptionClientIdentifier, packet.Options) + if len(vd.Serial) == 0 { + return nil, errors.New("client identifier option is missing") + } return vd, nil } |