Skip to content

Commit

Permalink
Revert "dpif-netlink: Don't destroy and recreate port if it exists"
Browse files Browse the repository at this point in the history
This reverts commit  a38dccb.

The original commit 7521e0c ("ofproto-dpif: Let the dpif report
when a port is a duplicate.") relies on the kernel to check if the
port exists or not. However, the current kernel code doesn't handle
when the port is moved to another network namespace.

Signed-off-by: Flavio Leitner <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
fleitner authored and blp committed Jan 25, 2019
1 parent b534330 commit c37cb3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dpif-netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ dpif_netlink_rtnl_port_create_and_add(struct dpif_netlink *dpif,
name = netdev_vport_get_dpif_port(netdev, namebuf, sizeof namebuf);
error = dpif_netlink_port_add__(dpif, name, OVS_VPORT_TYPE_NETDEV, NULL,
port_nop);
if (error && error != EEXIST) {
if (error) {
dpif_netlink_rtnl_port_destroy(name, netdev_get_type(netdev));
}
return error;
Expand All @@ -917,7 +917,7 @@ dpif_netlink_port_add(struct dpif *dpif_, struct netdev *netdev,
if (!ovs_tunnels_out_of_tree) {
error = dpif_netlink_rtnl_port_create_and_add(dpif, netdev, port_nop);
}
if (error && error != EEXIST) {
if (error) {
error = dpif_netlink_port_add_compat(dpif, netdev, port_nop);
}
fat_rwlock_unlock(&dpif->upcall_lock);
Expand Down

0 comments on commit c37cb3e

Please sign in to comment.