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 aae3f3d911484b8f15474e1ac42a26dcb879aec5..c0e8b1e860d25db7acb0fa7ec3f57eca9e41d644 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;
        }