mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
dpif-netdev: enumerate dpif belonging to the right class
Since dpif_netdev_enumerate() is used for "netdev" and "dummy" class, it incorrectly lists dpif-netdevs as "dummy" and vice versa. This patches address the issue by changing the dpif-provider interface: a dpif_class parameter is passed to the 'enumerate' call to match the right class. Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
committed by
Ben Pfaff
parent
277876e9c1
commit
2240af2576
@@ -360,12 +360,19 @@ get_dp_netdev(const struct dpif *dpif)
|
||||
}
|
||||
|
||||
static int
|
||||
dpif_netdev_enumerate(struct sset *all_dps)
|
||||
dpif_netdev_enumerate(struct sset *all_dps,
|
||||
const struct dpif_class *dpif_class)
|
||||
{
|
||||
struct shash_node *node;
|
||||
|
||||
ovs_mutex_lock(&dp_netdev_mutex);
|
||||
SHASH_FOR_EACH(node, &dp_netdevs) {
|
||||
struct dp_netdev *dp = node->data;
|
||||
if (dpif_class != dp->class) {
|
||||
/* 'dp_netdevs' contains both "netdev" and "dummy" dpifs.
|
||||
* If the class doesn't match, skip this dpif. */
|
||||
continue;
|
||||
}
|
||||
sset_add(all_dps, node->name);
|
||||
}
|
||||
ovs_mutex_unlock(&dp_netdev_mutex);
|
||||
|
Reference in New Issue
Block a user