Skip to content

Commit

Permalink
dhcpv6: explicitly ignore options that cannot be parsed
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Feb 19, 2023
1 parent 6773f0d commit ee037bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dhcpv6/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ func (o *Options) FromBytesWithParser(data []byte, optioner Optioner) error {

opt := optioner(code)
if opt == nil {
return fmt.Errorf("option code %d is invalid in this message", code)
// Most RFCs that define options say that options
// should be ignored in messages where they don't
// belong.
opt = &OptionGeneric{OptionCode: code}
}
if err := opt.FromBytes(optData); err != nil {
return err
Expand Down

0 comments on commit ee037bd

Please sign in to comment.