Commit 8d5e2730 authored by Daniel Salzman's avatar Daniel Salzman

zone-dump: remove master address from the footer

parent 0df2f032
......@@ -128,7 +128,7 @@ static int node_dump_text(zone_node_t *node, void *data)
return KNOT_EOK;
}
int zone_dump_text(zone_contents_t *zone, const struct sockaddr_storage *from, FILE *file)
int zone_dump_text(zone_contents_t *zone, FILE *file)
{
if (zone == NULL || file == NULL) {
return KNOT_EINVAL;
......@@ -222,14 +222,6 @@ int zone_dump_text(zone_contents_t *zone, const struct sockaddr_storage *from, F
";; Time %s\n",
params.rr_count, date);
// If a master server is configured, dump info about it.
if (from) {
char addr_str[SOCKADDR_STRLEN] = {0};
sockaddr_tostr(addr_str, sizeof(addr_str), from);
fprintf(file, ";; Transfered from %s\n", addr_str);
}
free(buf);
return KNOT_EOK;
......
......@@ -32,12 +32,11 @@
* \brief Dumps given zone to text file.
*
* \param zone Zone to be saved.
* \param from From where the zone originated.
* \param file File to write to.
*
* \retval KNOT_EOK on success.
* \retval < 0 if error.
*/
int zone_dump_text(zone_contents_t *zone, const struct sockaddr_storage *from, FILE *file);
int zone_dump_text(zone_contents_t *zone, FILE *file);
/*! @} */
......@@ -228,18 +228,10 @@ int zone_flush_journal(zone_t *zone)
return KNOT_EOK; /* No differences. */
}
/* Fetch zone source (where it came from). */
const struct sockaddr_storage *from = NULL;
conf_remote_t master;
if (zone_is_slave(zone)) {
master = zone_master(zone);
from = &master.addr;
}
char *zonefile = conf_zonefile(conf(), zone->name);
/* Synchronize journal. */
int ret = zonefile_write(zonefile, contents, from);
int ret = zonefile_write(zonefile, contents);
if (ret == KNOT_EOK) {
log_zone_info(zone->name, "zone file updated, serial %u -> %u",
zone->zonefile_serial, serial_to);
......
......@@ -348,8 +348,7 @@ static int zones_open_free_filename(const char *old_name, char **new_name)
return fd;
}
int zonefile_write(const char *path, zone_contents_t *zone,
const struct sockaddr_storage *from)
int zonefile_write(const char *path, zone_contents_t *zone)
{
if (!zone || !path) {
return KNOT_EINVAL;
......@@ -372,7 +371,7 @@ int zonefile_write(const char *path, zone_contents_t *zone,
return KNOT_ERROR;
}
if (zone_dump_text(zone, from, f) != KNOT_EOK) {
if (zone_dump_text(zone, f) != KNOT_EOK) {
WARNING(zname, "failed to save zone, file '%s'", new_fname);
fclose(f);
unlink(new_fname);
......
......@@ -84,8 +84,7 @@ time_t zonefile_mtime(const char *path);
/*!
* \brief Write zone contents to zone file.
*/
int zonefile_write(const char *path, zone_contents_t *zone,
const struct sockaddr_storage *from);
int zonefile_write(const char *path, zone_contents_t *zone);
/*!
* \brief Close zone file loader.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment