of_core receives data from Kytos Async TCP server as raw_bytes (possibly aggregated) and transform them into individual OpenFlow messages. As part of this routine, of_slicer() is the one responsible for splitting the raw data into individual OpenFlow messages (set of bytes) to be later parsed into OpenFlow objects using python-openflow. of_slicer also takes into consideration that the received bytes can represent incomplete messages (due, for instance, to the socket read buffer), and it will return the list of individual packets and the remaining data. The slicing process does not validated some situations, which can lead to inconsistent messages, infinity loop at the server and memory exhaustion.
This PR will add some sanity checks to the slicing process, to avoid those errors.
Release notes
Added sanity checks to of_slicer() to prevent against server's resource exhaustion when receiving badly formatted OpenFlow packets.
Fixes #23
Description of the change
of_core receives data from Kytos Async TCP server as raw_bytes (possibly aggregated) and transform them into individual OpenFlow messages. As part of this routine,
of_slicer()
is the one responsible for splitting the raw data into individual OpenFlow messages (set of bytes) to be later parsed into OpenFlow objects using python-openflow. of_slicer also takes into consideration that the received bytes can represent incomplete messages (due, for instance, to the socket read buffer), and it will return the list of individual packets and the remaining data. The slicing process does not validated some situations, which can lead to inconsistent messages, infinity loop at the server and memory exhaustion.This PR will add some sanity checks to the slicing process, to avoid those errors.
Release notes