summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-10-21 17:27:55 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-10-21 17:27:55 -0700
commita5e5ddbbc35fca7a33e2c14d7e4b2e068e01da51 (patch)
tree406b03f50edc381ccfdcfd0c375b06035cca281a /src
parent9817f6e3a0581263cdec34a8c914bf41052c73ed (diff)
downloadvyatta-cfg-a5e5ddbbc35fca7a33e2c14d7e4b2e068e01da51.tar.gz
vyatta-cfg-a5e5ddbbc35fca7a33e2c14d7e4b2e068e01da51.zip
priorities should match up on all nodes now, except where the priority file diverges from the node.defs
commit behavior has not changed yet, but can be completely switched over to node.def priority system with simple change.
Diffstat (limited to 'src')
-rw-r--r--src/common/unionfs.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/common/unionfs.c b/src/common/unionfs.c
index 8f7341a..d5f9d3f 100644
--- a/src/common/unionfs.c
+++ b/src/common/unionfs.c
@@ -231,7 +231,13 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
}
//either multi or tag--shouldn't have made a difference, but arkady was confused.
vn->_config._multi = (def.tag | def.multi);
- vn->_config._priority = def.def_priority;
+ if (def.def_priority == 0) {
+ vn->_config._priority = LOWEST_PRIORITY;
+ }
+ else {
+ vn->_config._priority = def.def_priority;
+ }
+
}
}
@@ -248,6 +254,16 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op)
if (vn_parent->_config._multi == TRUE) {
((struct VyattaNode*)node->data)->_data._value = TRUE;
+ //patch up to preserve multinode behavior on value node, can also put node.def on node.tag with priority
+ //Need to do two things:
+ // 1. Come to agreement on where the behavior splits on priority multinodes
+ // 2. Not check for tag node in the def datastructure but use the new datastructure as at some point tag and multi will be the same
+ if (vn_parent->_config._def.tag == TRUE) { //only for embedded multinodes
+ vn->_config._priority = vn_parent->_config._priority;
+ vn_parent->_config._priority = LOWEST_PRIORITY;
+ }
+
+
//now let's patch up the def multi-nodes
//move the def for the multinode from the parent to the value node
struct VyattaNode* vn2 = (struct VyattaNode*)node->data;