mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
packet/bgp: Fix TunnelEncapSubTLV.DecodeFromBytes
Return data of the correct length from TunnelEncapSubTLV.DecodeFromBytes. This fixes a problem with TunnelEncapSubTLVUnknown which caused it to contain more bytes in its Value unless it was the last SubTLV. Signed-off-by: Mikael Magnusson <[email protected]>
This commit is contained in:
@@ -11393,7 +11393,7 @@ func (t *TunnelEncapSubTLV) DecodeFromBytes(data []byte) (value []byte, err erro
|
||||
if len(data) < int(t.Length) {
|
||||
return nil, NewMessageError(BGP_ERROR_UPDATE_MESSAGE_ERROR, BGP_ERROR_SUB_MALFORMED_ATTRIBUTE_LIST, nil, "Not all TunnelEncapSubTLV bytes available")
|
||||
}
|
||||
return data, nil
|
||||
return data[:t.Length], nil
|
||||
}
|
||||
|
||||
func (t *TunnelEncapSubTLV) Serialize(value []byte) (buf []byte, err error) {
|
||||
|
||||
Reference in New Issue
Block a user