Skip to content

Commit

Permalink
improved fix for bnc#291301 (write also values that wasn't readed)
Browse files Browse the repository at this point in the history
svn path=/trunk/slp-server/; revision=62788
  • Loading branch information
Michal Žugec committed Nov 9, 2010
1 parent 3ef67c8 commit 4a1ce4d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 36 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.19.0
2.20.0
6 changes: 6 additions & 0 deletions package/yast2-slp-server.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Nov 9 16:23:16 CET 2010 - mzugec@suse.cz

- improved fix for bnc#291301 (write also values that wasn't readed)
- 2.20.0

-------------------------------------------------------------------
Mon Jun 28 16:14:37 CEST 2010 - mzugec@suse.cz

Expand Down
52 changes: 17 additions & 35 deletions src/SlpServer.ycp
Expand Up @@ -126,54 +126,36 @@ boolean ReadGlobalConfig(){

// write global configuration file /etc/slp.conf
boolean WriteGlobalConfig(){
/*
list<string> correct_case2 = [
"net.slp.useScopes",
"net.slp.DAAddresses",
"net.slp.isDA",
"net.slp.DAHeartBeat",
"net.slp.watchRegistrationPID",
"net.slp.maxResults",
"net.slp.isBroadcastOnly",
"net.slp.passiveDADetection",
"net.slp.activeDADetection",
"net.slp.DAActiveDiscoveryInterval",
"net.slp.multicastTTL",
"net.slp.DADiscoveryMaximumWait",
"net.slp.DADiscoveryTimeouts",
"net.slp.multicastMaximumWait",
"net.slp.multicastTimeouts",
"net.slp.unicastMaximumWait",
"net.slp.unicastTimeouts",
"net.slp.datagramTimeouts",
"net.slp.randomWaitBound",
"net.slp.MTU",
"net.slp.interfaces",
"net.slp.securityEnabled",
"net.slp.checkSourceAddr",
"net.slp.traceDATraffic",
"net.slp.traceReg",
"net.slp.traceDrop",
"net.slp.traceMsg"
];
*/

foreach(string k1, any v1, slp_config, {
SETTINGS["value"] = maplist(map<string, any > v2, (list < map<string, any> >) SETTINGS["value"]:nil, {
boolean found=false;
SETTINGS["value"] = maplist(map<string, any > v2, (list < map<string, any> >) SETTINGS["value"]:[], {
if (k1 == v2["name"]:"")
{
v2["type"]= (v1 == nil) ? 0 : 1;
v2["value"]=v1;
found=true;
}
return v2;
});
if (!found) SETTINGS["value"]=add(SETTINGS["value"]:[],
$[
"name" : k1,
"type" : (v1 == nil) ? 0 : 1,
"kind" : "value",
"comment":"",
"value": v1
]
);
});

y2internal("slp_config %1", slp_config);
y2milestone("slp_config %1", slp_config);
y2milestone("SETTINGS %1", SETTINGS);

REGFILES["value"] = reg_files;

y2milestone("write reg_files %1", reg_files);
y2milestone("write REGFILES %1", REGFILES);
y2debug("write reg_files %1", reg_files);
y2debug("write REGFILES %1", REGFILES);

SCR::Write(.etc.slp.all, SETTINGS);
SCR::Write(.etc.slp.reg.all, REGFILES);
Expand Down

0 comments on commit 4a1ce4d

Please sign in to comment.