diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-11-12 09:49:04 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-11-12 09:49:04 -0800 |
commit | ddc25a06ac3a1fc76491a89c71f20a499b5d8187 (patch) | |
tree | 0c126ae4d3ded51d4b362649f1b73b7df1b08fc4 /src | |
parent | 5956c4053c0de30a6d9028773b3540dc37534923 (diff) | |
parent | 472c42136c47446b3980335aa819df6bcff5caa3 (diff) | |
download | vyatta-cfg-ddc25a06ac3a1fc76491a89c71f20a499b5d8187.tar.gz vyatta-cfg-ddc25a06ac3a1fc76491a89c71f20a499b5d8187.zip |
Merge branch 'kenwood' of suva.vyatta.com:/git/vyatta-cfg into kenwood
Diffstat (limited to 'src')
-rw-r--r-- | src/cli_def.l | 1 | ||||
-rw-r--r-- | src/common/unionfs.c | 37 |
2 files changed, 23 insertions, 15 deletions
diff --git a/src/cli_def.l b/src/cli_def.l index d73f1c4..721e5f0 100644 --- a/src/cli_def.l +++ b/src/cli_def.l @@ -271,6 +271,7 @@ RE_ACT_FIELD (help|syntax|commit|delete|update|activate|create|begin|end|comp_he #[^\n]*\n { /* comment */ ++yy_cli_def_lineno; + return EOL; } \n { diff --git a/src/common/unionfs.c b/src/common/unionfs.c index 45127e8..ed40bf8 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -225,13 +225,6 @@ 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); - if (def.def_priority == 0) { - vn->_config._priority = LOWEST_PRIORITY; - } - else { - vn->_config._priority = def.def_priority; - } - } } @@ -252,12 +245,6 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op) //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; @@ -282,6 +269,25 @@ retrieve_data(char* rel_data_path, GNode *node, char* root, NODE_OPERATION op) } } + + if (G_NODE_IS_ROOT(node) == FALSE) { + struct VyattaNode* vn_parent = (struct VyattaNode*)node->parent->data; + struct VyattaNode* vn = (struct VyattaNode*)node->data; + // vn->_config._priority = vn_parent->_config._def.def_priority; + if (vn->_config._def.tag && vn->_config._multi) { + vn->_config._priority = LOWEST_PRIORITY; + } + else if (vn->_config._def.def_priority == 0) { + vn->_config._priority = LOWEST_PRIORITY; + } + else { + vn->_config._priority = vn->_config._def.def_priority; + } + } + + + + if (final_node == TRUE) { //move defs to child... get_term_data_values(node); @@ -1017,8 +1023,9 @@ dlist_test_func(GQuark key_id,gpointer data,gpointer user_data) if (vn->_data._value == TRUE) { new_vn = copy_vyatta_node(vn); GNode *new_node = g_node_new(new_vn); - //g_node_insert(node, -1, new_node); - insert_sibling_in_order(node,new_node); + // g_node_insert(node, -1, new_node); + g_node_insert_after(node, NULL, new_node); + // insert_sibling_in_order(node,new_node); new_vn->_config._def = vn->_config._def; } else { |