[Toybox] [patch] dumpleases

Hyejin Kim hj8296 at gmail.com
Mon Apr 27 02:33:44 PDT 2015


Hi.

Even though udhcpc/udhcpd chaged to dhcp/dhcpd,
leases default file path didnt change.

dhcpd writes leases on "dhcpd.leases" file.

line 547  {"lease_file"   , strinvar        , (void*)&gconfig.lease_file
, "/var/lib/misc/dhcpd.leases"}, //LEASES_FILE

but, dumpleases read from "udhcpd.leases".

plz, check my patch.



diff --git a/toys/pending/dumpleases.c b/toys/pending/dumpleases.c
index fec3955..86cb4e7 100644
--- a/toys/pending/dumpleases.c
+++ b/toys/pending/dumpleases.c
@@ -41,7 +41,7 @@ void dumpleases_main(void)
   int64_t written_time , current_time, exp;
   int i, fd;

-  if(!(toys.optflags & FLAG_f)) TT.file = "/var/lib/misc/udhcpd.leases";
//DEF_LEASE_FILE
+  if(!(toys.optflags & FLAG_f)) TT.file = "/var/lib/misc/dhcpd.leases";
//DEF_LEASE_FILE
   fd = xopen(TT.file, O_RDONLY);
   xprintf("Mac Address       IP Address      Host Name           Expires
%s\n", (toys.optflags & FLAG_a) ? "at" : "in");
   xread(fd, &written_time, sizeof(written_time));
-- 
1.9.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150427/710e721f/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dumpleases-fix-default-leases-file-path-as-the-same-.patch
Type: application/octet-stream
Size: 990 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150427/710e721f/attachment-0004.obj>


More information about the Toybox mailing list