tunneling: Update port pools on config change.
[sliver-openvswitch.git] / datapath / tunnel.c
index 0faa4ec..d8bcb0f 100644 (file)
@@ -247,6 +247,7 @@ 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;
        }
@@ -282,7 +283,9 @@ static int move_port(struct vport *vport, struct tnl_mutable_config *new_mutable
        }
 
 table_updated:
+       (*find_port_pool(tnl_vport->mutable))--;
        assign_config_rcu(vport, new_mutable);
+       (*find_port_pool(tnl_vport->mutable))++;
 
        return 0;
 }