tunneling: Fix updated port pools commit.
authorJesse Gross <jesse@nicira.com>
Fri, 10 Dec 2010 01:52:39 +0000 (17:52 -0800)
committerJesse Gross <jesse@nicira.com>
Fri, 10 Dec 2010 01:52:39 +0000 (17:52 -0800)
If readding a tunnel to the table fails during move_port(), we
should decrement the port pool counter that it is in.  However,
when I attempted to do this, I accidentally put it in add_port().

Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/tunnel.c

index aae3f3d..c0e8b1e 100644 (file)
@@ -247,7 +247,6 @@ static int add_port(struct vport *vport)
 
        err = tbl_insert(port_table, &tnl_vport->tbl_node, mutable_hash(tnl_vport->mutable));
        if (err) {
-               (*find_port_pool(tnl_vport->mutable))--;
                check_table_empty();
                return err;
        }
@@ -278,6 +277,7 @@ static int move_port(struct vport *vport, struct tnl_mutable_config *new_mutable
 
        err = tbl_insert(port_table, &tnl_vport->tbl_node, hash);
        if (err) {
+               (*find_port_pool(tnl_vport->mutable))--;
                check_table_empty();
                return err;
        }