diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2017-04-28 23:01:23 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2017-04-28 23:01:23 +0100 |
commit | efff74c1aea14757ce074db28e02671c7f7bb5f5 (patch) | |
tree | 942ac141a27433daecbb15905ede48d83b3c8104 | |
parent | a9df0e30b06675ac8042d434af9a319764ed2f08 (diff) | |
download | dnsmasq-efff74c1aea14757ce074db28e02671c7f7bb5f5.tar.gz |
Tweak logging introduced in 3a8b0f6fccf464b1ec6d24c0e00e540ab2b17705v2.77test5
-rw-r--r-- | src/lease.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lease.c b/src/lease.c index 04fc189..5afb99b 100644 --- a/src/lease.c +++ b/src/lease.c @@ -172,10 +172,13 @@ void lease_init(time_t now) if (leasestream) { - readok = read_leases(now, leasestream); + if (!(readok = read_leases(now, leasestream))) + my_syslog(MS_DHCP | LOG_ERR, _("failed to parse lease database, invalid line: %s %s %s %s ..."), + daemon->dhcp_buff3, daemon->dhcp_buff2, + daemon->namebuff, daemon->dhcp_buff); + if (ferror(leasestream)) die(_("failed to read lease file %s: %s"), daemon->lease_file, EC_FILE); - } #ifdef HAVE_SCRIPT @@ -200,16 +203,11 @@ void lease_init(time_t now) die(_("lease-init script returned exit code %s"), daemon->dhcp_buff, WEXITSTATUS(rc) + EC_INIT_OFFSET); } - /* Only complain if we stopped reading due to a non-parsed line when running script, + /* Only die if we stopped reading due to a non-parsed line when running script, this is expected behaviour when reading from a file, if the file was written with IPv6 data and we are not compiled to understand that. */ if (!readok) - { - my_syslog(MS_DHCP | LOG_ERR, _("aborting lease-init script, invalid line: %s %s %s %s ..."), - daemon->dhcp_buff3, daemon->dhcp_buff2, - daemon->namebuff, daemon->dhcp_buff); - die(_("failed to parse lease-init script output"), NULL, EC_FILE); - } + die(_("failed to read lease-init script output"), NULL, EC_FILE); } #endif |