vlist: fix node version update for tree->keep_old/no_delete
authorFelix Fietkau <nbd@openwrt.org>
Thu, 2 Feb 2012 23:14:50 +0000 (00:14 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 2 Feb 2012 23:14:50 +0000 (00:14 +0100)
utils.c

diff --git a/utils.c b/utils.c
index 0b800646b531d613ada3cf47cd81ba40c6e3e5c7..0b13f86c7c2fd514f50c6ade39c5dec1fdf14490 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -40,8 +40,10 @@ vlist_add(struct vlist_tree *tree, struct vlist_node *node)
        anode = avl_find(&tree->avl, key);
        if (anode) {
                old_node = container_of(anode, struct vlist_node, avl);
-               if (tree->keep_old || tree->no_delete)
+               if (tree->keep_old || tree->no_delete) {
+                       old_node->version = tree->version;
                        goto update_only;
+               }
 
                avl_delete(&tree->avl, anode);
        }