Dmytro Titov a1010de8ea [ONOS-8000] Use passed length for Data payload
Current code can broke a packet during serialization due to bug in
the "Data.deserialize" call. According to the IEEE Std 802.3 standard
an ethernet frame can not have the payload less then 46 bytes. When
the ethernet frame have shorter payload it padded with zeros.

We observed that for short UDP packets deserialize methods for both
the IPv4 and UDP packets calculate length correctly, but the Data
payload deserialization method ignores passed length and takess all
data up to end of the buffer with ethernet frame.

Suggested changes change the Data deserialization method to use only
passed "length" bytes instead of whole remaining "data" buffer.

Change-Id: I6b93458a8925a0924f3830e3a5d5763369e8ea92
2019-06-17 12:37:33 +00:00
..