mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 14:55:18 +00:00
dpif-netdev: Reject adding duplicate ports.
Otherwise it is at least very confusing. Found during testing. An upcoming commit adds a test. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
This commit is contained in:
@@ -1035,7 +1035,10 @@ do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
|
|||||||
int error;
|
int error;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* XXX reject devices already in some dp_netdev. */
|
/* Reject devices already in 'dp'. */
|
||||||
|
if (!get_port_by_name(dp, devname, &port)) {
|
||||||
|
return EEXIST;
|
||||||
|
}
|
||||||
|
|
||||||
/* Open and validate network device. */
|
/* Open and validate network device. */
|
||||||
open_type = dpif_netdev_port_open_type(dp->class, type);
|
open_type = dpif_netdev_port_open_type(dp->class, type);
|
||||||
|
Reference in New Issue
Block a user