aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/files.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-06-17 13:24:03 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-06-17 13:24:03 +0200
commit6947d2c7e194e3be31eed1c75260e15fca1a2568 (patch)
treeff4d67b49e0e7e02e29ecc090db619a39b24498d /networking/udhcp/files.c
parent2b0e95780863da44f6a9244699ece8620a599e19 (diff)
downloadbusybox-w32-6947d2c7e194e3be31eed1c75260e15fca1a2568.tar.gz
busybox-w32-6947d2c7e194e3be31eed1c75260e15fca1a2568.tar.bz2
busybox-w32-6947d2c7e194e3be31eed1c75260e15fca1a2568.zip
udhcp: logging improvements, field and variable renames
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/files.c')
-rw-r--r--networking/udhcp/files.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index bddf3e141..c3cc2b0f5 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -295,7 +295,7 @@ static const struct config_keyword keywords[] = {
295 {"decline_time", read_u32, &(server_config.decline_time), "3600"}, 295 {"decline_time", read_u32, &(server_config.decline_time), "3600"},
296 {"conflict_time",read_u32, &(server_config.conflict_time),"3600"}, 296 {"conflict_time",read_u32, &(server_config.conflict_time),"3600"},
297 {"offer_time", read_u32, &(server_config.offer_time), "60"}, 297 {"offer_time", read_u32, &(server_config.offer_time), "60"},
298 {"min_lease", read_u32, &(server_config.min_lease), "60"}, 298 {"min_lease", read_u32, &(server_config.min_lease_sec),"60"},
299 {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE}, 299 {"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
300 {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"}, 300 {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
301 {"siaddr", read_nip, &(server_config.siaddr_nip), "0.0.0.0"}, 301 {"siaddr", read_nip, &(server_config.siaddr_nip), "0.0.0.0"},
@@ -359,23 +359,23 @@ void FAST_FUNC write_leases(void)
359 for (i = 0; i < server_config.max_leases; i++) { 359 for (i = 0; i < server_config.max_leases; i++) {
360 leasetime_t tmp_time; 360 leasetime_t tmp_time;
361 361
362 if (leases[i].lease_nip == 0) 362 if (g_leases[i].lease_nip == 0)
363 continue; 363 continue;
364 364
365 /* Screw with the time in the struct, for easier writing */ 365 /* Screw with the time in the struct, for easier writing */
366 tmp_time = leases[i].expires; 366 tmp_time = g_leases[i].expires;
367 367
368 leases[i].expires -= curr; 368 g_leases[i].expires -= curr;
369 if ((signed_leasetime_t) leases[i].expires < 0) 369 if ((signed_leasetime_t) g_leases[i].expires < 0)
370 leases[i].expires = 0; 370 g_leases[i].expires = 0;
371 leases[i].expires = htonl(leases[i].expires); 371 g_leases[i].expires = htonl(g_leases[i].expires);
372 372
373 /* No error check. If the file gets truncated, 373 /* No error check. If the file gets truncated,
374 * we lose some leases on restart. Oh well. */ 374 * we lose some leases on restart. Oh well. */
375 full_write(fd, &leases[i], sizeof(leases[i])); 375 full_write(fd, &g_leases[i], sizeof(g_leases[i]));
376 376
377 /* Then restore it when done */ 377 /* Then restore it when done */
378 leases[i].expires = tmp_time; 378 g_leases[i].expires = tmp_time;
379 } 379 }
380 close(fd); 380 close(fd);
381 381