The size of each slave is a uint16_t. This means that each slave needs 2 bytes
at the end of nx_action_bundle. Earlier, the size of each slave was not being
factored in when allocating space. This commit corrects that by allocating 2
bytes for each slave when calculating the total number of bytes to be allocated
at the end of nx_action_bundle.
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
void
bundle_to_nxast(const struct ofpact_bundle *bundle, struct ofpbuf *openflow)
{
- int slaves_len = ROUND_UP(bundle->n_slaves, OFP_ACTION_ALIGN);
+ int slaves_len = ROUND_UP(2 * bundle->n_slaves, OFP_ACTION_ALIGN);
struct nx_action_bundle *nab;
ovs_be16 *slaves;
size_t i;