diff options
author | Ben Pfaff <blp@nicira.com> | 2009-06-17 14:22:57 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2009-07-06 09:07:24 -0700 |
commit | bb8a9a2b0ea8ced4c285c24e98d2e14656130841 (patch) | |
tree | 8cfa8b3795a2bda87e97d0c1d3873d872b8dfec3 /utilities | |
parent | f7ef6533d8e48565f21a67021e8477b6f5a59ae3 (diff) | |
download | openvswitch-bb8a9a2b0ea8ced4c285c24e98d2e14656130841.tar.gz |
dpif: Change dpif_port_group_get() semantics.
This function is easier for callers to use if they do not have to guess
how many ports are in the group. Since it's not performance critical at
all, introduce these easier semantics.
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-dpctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c index 92d1d2d6a..9f45b3add 100644 --- a/utilities/ovs-dpctl.c +++ b/utilities/ovs-dpctl.c @@ -515,11 +515,10 @@ do_dump_groups(int argc UNUSED, char *argv[]) run(dpif_open(argv[1], &dpif), "opening datapath"); run(dpif_get_dp_stats(dpif, &stats), "get datapath stats"); for (i = 0; i < stats.max_groups; i++) { - uint16_t ports[UINT16_MAX]; + uint16_t *ports; size_t n_ports; - if (!dpif_port_group_get(dpif, i, ports, - ARRAY_SIZE(ports), &n_ports) && n_ports) { + if (!dpif_port_group_get(dpif, i, &ports, &n_ports) && n_ports) { size_t j; printf("group %u:", i); @@ -528,6 +527,7 @@ do_dump_groups(int argc UNUSED, char *argv[]) } printf("\n"); } + free(ports); } dpif_close(dpif); } |