assert(netdev_dev->netdev_class == class);
} else if (!shash_is_empty(options->args) &&
- !smap_equal(&netdev_dev->args, options->args)) {
+ !netdev_dev_args_equal(netdev_dev, options->args)) {
VLOG_WARN("%s: attempted to open already open netdev with "
"different arguments", options->name);
}
if (netdev_dev->netdev_class->set_config) {
- if (!smap_equal(&netdev_dev->args, args)) {
+ if (!netdev_dev_args_equal(netdev_dev, args)) {
update_device_args(netdev_dev, args);
return netdev_dev->netdev_class->set_config(netdev_dev, args);
}
}
}
+/* Returns true if 'args' is equivalent to the "args" field in
+ * 'netdev_dev', otherwise false. */
+bool
+netdev_dev_args_equal(const struct netdev_dev *netdev_dev,
+ const struct shash *args)
+{
+ if (netdev_dev->netdev_class->config_equal) {
+ return netdev_dev->netdev_class->config_equal(netdev_dev, args);
+ } else {
+ return smap_equal(&netdev_dev->args, args);
+ }
+}
+
/* Initializes 'netdev' as a instance of the netdev_dev.
*
* This function adds 'netdev' to a netdev-owned linked list, so it is very