diff options
Diffstat (limited to 'networking/udhcp/dumpleases.c')
-rw-r--r-- | networking/udhcp/dumpleases.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index c0d515d28..1558f8848 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c | |||
@@ -47,8 +47,9 @@ int dumpleases_main(int argc UNUSED_PARAM, char **argv) | |||
47 | 47 | ||
48 | fd = xopen(file, O_RDONLY); | 48 | fd = xopen(file, O_RDONLY); |
49 | 49 | ||
50 | printf("Mac Address IP-Address Expires %s\n", (opt & OPT_a) ? "at" : "in"); | 50 | printf("Mac Address IP Address Host Name Expires %s\n", (opt & OPT_a) ? "at" : "in"); |
51 | /* "00:00:00:00:00:00 255.255.255.255 Wed Jun 30 21:49:08 1993" */ | 51 | /* "00:00:00:00:00:00 255.255.255.255 ABCDEFGHIJKLMNOPQRS Wed Jun 30 21:49:08 1993" */ |
52 | /* "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 */ | ||
52 | 53 | ||
53 | if (full_read(fd, &written_at, sizeof(written_at)) != sizeof(written_at)) | 54 | if (full_read(fd, &written_at, sizeof(written_at)) != sizeof(written_at)) |
54 | return 0; | 55 | return 0; |
@@ -64,7 +65,9 @@ int dumpleases_main(int argc UNUSED_PARAM, char **argv) | |||
64 | fmt = ":%02x"; | 65 | fmt = ":%02x"; |
65 | } | 66 | } |
66 | addr.s_addr = lease.yiaddr; | 67 | addr.s_addr = lease.yiaddr; |
67 | printf(" %-15s ", inet_ntoa(addr)); | 68 | /* actually, 15+1 and 19+1, +1 is a space between columns */ |
69 | /* lease.hostname is char[20] and is always NUL terminated */ | ||
70 | printf(" %-16s%-20s", inet_ntoa(addr), lease.hostname); | ||
68 | expires_abs = ntohl(lease.expires) + written_at; | 71 | expires_abs = ntohl(lease.expires) + written_at; |
69 | if (expires_abs <= curr) { | 72 | if (expires_abs <= curr) { |
70 | puts("expired"); | 73 | puts("expired"); |