+int config_set(struct config *newconfig)
+{
+ int rc;
+
+ if (!storage || !storage->save)
+ return -1;
+
+ if (newconfig == config)
+ return 0;
+
+ pb_log("new configuration data received\n");
+ dump_config(config);
+
+ rc = storage->save(storage, config);
+
+ if (!rc)
+ config = talloc_steal(config_ctx, newconfig);
+ else
+ pb_log("error saving new configuration; changes lost\n");
+
+ return rc;
+}
+