2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-13 14:07:02 +00:00

netdev: Remove may_create/may_open flags.

The most recent revision of the netdev library added may_create
and may_open flags to explicitly state the intent of the caller as
to whether the device should already be in use.  This was simply
a sanity check for users of the netdev library and the configuration.
At this point the netdev library and its users are well behaved and
should no longer need to be checked.  Additional checks have also
been added for incorrect configuration that mean the netdev library
is no longer the primary line of defense.

These flags themselves create problems because it is not always
easy for a library to know what the state of devices should be.
This is particularly a problem for ovs-openflowd, which expects
ports to be added by ovs-dpctl.  Fixing this either requires that
the checks are so permissive to be useless or ugly hacks to get
around them.  Since they are no longer needed, just remove the
checks.

This commit restores the previous behavior of ovs-openflowd to
not require that ports be specified on the command line or
cleaned up after use.

Bug #2652

CC: Natasha Gude <natasha@nicira.com>
CC: Jean Tourrilhes <jt@hpl.hp.com>
CC: 蒲彦 <yan.p.bjtu@gmail.com>
This commit is contained in:
Jesse Gross
2010-06-01 14:20:59 -07:00
parent 61b999dd6f
commit 1e82e503c5
7 changed files with 6 additions and 47 deletions

View File

@@ -375,11 +375,8 @@ do_add_port(struct dp_netdev *dp, const char *devname, uint16_t flags,
memset(&netdev_options, 0, sizeof netdev_options);
netdev_options.name = devname;
netdev_options.ethertype = NETDEV_ETH_TYPE_ANY;
netdev_options.may_create = true;
if (internal) {
netdev_options.type = "tap";
} else {
netdev_options.may_open = true;
}
error = netdev_open(&netdev_options, &netdev);