Skip to content

Commit

Permalink
Merge pull request #181 from fujita/fix-openmsg-parser
Browse files Browse the repository at this point in the history
fix UnmarshalBGPOpenMessage
  • Loading branch information
sbezverk authored Dec 17, 2021
2 parents 342518f + 8d8872f commit e886299
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/bgp/bgp-open.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func UnmarshalBGPOpenMessage(b []byte) (*OpenMessage, error) {
if glog.V(6) {
glog.Infof("BGPOpenMessage Raw: %s", tools.MessageHex(b))
}
if len(b) < BGPMinOpenMessageLength {
if len(b) < BGPMinOpenMessageLength-16 {
return nil, fmt.Errorf("BGP Open Message length %d is invalid", len(b))
}
var err error
Expand Down

0 comments on commit e886299

Please sign in to comment.