summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorDaniele Di Proietto <diproiettod@vmware.com>2016-04-01 18:31:22 -0700
committerDaniele Di Proietto <diproiettod@vmware.com>2016-05-23 10:10:23 -0700
commitbfbcebc27297cfaf97f338a51e3567824d483c8d (patch)
treea62fd656463407d8ab205dc7e1948c9b1ee836db /ofproto
parentd0cca6c344dca105d25ebae2afd1b9e5db021f61 (diff)
downloadopenvswitch-bfbcebc27297cfaf97f338a51e3567824d483c8d.tar.gz
hmap: Use struct for hmap_at_position().
The interface will be more similar to the cmap. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Tested-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Ilya Maximets <i.maximets@samsung.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 3bd26ac7d..63d9c8d35 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3521,8 +3521,7 @@ port_get_lacp_stats(const struct ofport *ofport_, struct lacp_slave_stats *stats
}
struct port_dump_state {
- uint32_t bucket;
- uint32_t offset;
+ struct sset_position pos;
bool ghost;
struct ofproto_port port;
@@ -3550,7 +3549,7 @@ port_dump_next(const struct ofproto *ofproto_, void *state_,
state->has_port = false;
}
sset = state->ghost ? &ofproto->ghost_ports : &ofproto->ports;
- while ((node = sset_at_position(sset, &state->bucket, &state->offset))) {
+ while ((node = sset_at_position(sset, &state->pos))) {
int error;
error = port_query_by_name(ofproto_, node->name, &state->port);
@@ -3565,8 +3564,7 @@ port_dump_next(const struct ofproto *ofproto_, void *state_,
if (!state->ghost) {
state->ghost = true;
- state->bucket = 0;
- state->offset = 0;
+ memset(&state->pos, 0, sizeof state->pos);
return port_dump_next(ofproto_, state_, port);
}