ofp-print-ofctl: Free group buckets.
[cascardo/ovs.git] / lib / ofp-print.c
index 0ad06f0..e3a4172 100644 (file)
@@ -1899,6 +1899,23 @@ ofp_print_ofpst_queue_reply(struct ds *string, const struct ofp_header *oh,
     }
 }
 
+static void
+ofp_print_ofpst_port_desc_request(struct ds *string,
+                                  const struct ofp_header *oh)
+{
+    enum ofperr error;
+    ofp_port_t port;
+
+    error = ofputil_decode_port_desc_stats_request(oh, &port);
+    if (error) {
+        ofp_print_error(string, error);
+        return;
+    }
+
+    ds_put_cstr(string, " port=");
+    ofputil_format_port(port, string);
+}
+
 static void
 ofp_print_ofpst_port_desc_reply(struct ds *string,
                                 const struct ofp_header *oh)
@@ -2385,6 +2402,7 @@ ofp_print_group_desc(struct ds *s, const struct ofp_header *oh)
         ds_put_char(s, '\n');
         ds_put_char(s, ' ');
         ofp_print_group(s, gd.group_id, gd.type, &gd.buckets);
+        ofputil_bucket_list_destroy(&gd.buckets);
      }
 }
 
@@ -2525,6 +2543,7 @@ ofp_print_group_mod(struct ds *s, const struct ofp_header *oh)
     ds_put_char(s, ' ');
 
     ofp_print_group(s, gm.group_id, gm.type, &gm.buckets);
+    ofputil_bucket_list_destroy(&gm.buckets);
 }
 
 static const char *
@@ -2917,7 +2936,6 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
         break;
 
     case OFPTYPE_DESC_STATS_REQUEST:
-    case OFPTYPE_PORT_DESC_STATS_REQUEST:
     case OFPTYPE_METER_FEATURES_STATS_REQUEST:
         ofp_print_stats_request(string, oh);
         break;
@@ -2972,6 +2990,11 @@ ofp_to_string__(const struct ofp_header *oh, enum ofpraw raw,
         ofp_print_aggregate_stats_reply(string, oh);
         break;
 
+    case OFPTYPE_PORT_DESC_STATS_REQUEST:
+        ofp_print_stats_request(string, oh);
+        ofp_print_ofpst_port_desc_request(string, oh);
+        break;
+
     case OFPTYPE_PORT_DESC_STATS_REPLY:
         ofp_print_stats_reply(string, oh);
         ofp_print_ofpst_port_desc_reply(string, oh);