Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion oflib/ofl-messages-unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,7 @@ ofl_msg_unpack_queue_get_config_reply(struct ofp_header const *src, size_t *len,
struct ofp_packet_queue *queue;
ofl_err error;
size_t i;
size_t len1=0,len2=0;

if (*len < sizeof(struct ofp_queue_get_config_reply)) {
OFL_LOG_WARN(LOG_MODULE, "Received GET_CONFIG_REPLY has invalid length (%zu).", *len);
Expand All @@ -1612,13 +1613,18 @@ ofl_msg_unpack_queue_get_config_reply(struct ofp_header const *src, size_t *len,

queue = sr->queues;
for (i = 0; i < dr->queues_num; i++) {
error = ofl_structs_packet_queue_unpack(queue, len, &(dr->queues[i]));
/* This is so that it can parse packet with more than 1 queue.
* Previously, dpctl was showing only 1 queue even if more than 1 queues are configured. */
len1=*len-(sizeof(struct ofp_packet_queue)+sizeof(struct ofp_queue_prop_min_rate))*((int)dr->queues_num-1-i);
len2=*len-(sizeof(struct ofp_packet_queue)+sizeof(struct ofp_queue_prop_min_rate))*((int)dr->queues_num-1-i);
error = ofl_structs_packet_queue_unpack(queue, &len1, &(dr->queues[i]));
if (error) {
OFL_UTILS_FREE_ARR_FUN(dr->queues, i,
ofl_structs_free_packet_queue);
free (dr);
return error;
}
*len-=len2-len1; //This is so that it can parse packet with more than 1 queue.
queue = (struct ofp_packet_queue *)((uint8_t *)queue + ntohs(queue->len));
}

Expand Down