]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow interface to also be a path to a DHCP wire formatted file.
authorRoy Marples <roy@marples.name>
Tue, 24 Aug 2010 10:36:20 +0000 (10:36 +0000)
committerRoy Marples <roy@marples.name>
Tue, 24 Aug 2010 10:36:20 +0000 (10:36 +0000)
dhcpcd.8.in
dhcpcd.c

index b966746b4ad4cdb79b3e164e3de2eadf8eb4e283..31796ea9f0d1ed974fe0160d05fe8b97db663029 100644 (file)
@@ -495,6 +495,8 @@ before starting
 Dumps the last lease for the
 .Ar interface
 to stdout.
+.Ar interface
+could also be a path to a DHCP wire formatted file.
 .It Fl V, -variables
 Display a list of option codes and the associated variable for use in
 .Xr dhcpcd-run-hooks 8 .
index 07e68ed421422c0a903de78574cd5b7723d8012e..1678e5eba7bb17254bd96cdd90e10a548457f93e 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1780,6 +1780,11 @@ main(int argc, char **argv)
                strlcpy(iface->state->options->script, if_options->script,
                    sizeof(iface->state->options->script));
                iface->state->new = read_lease(iface);
+               if (iface->state->new == NULL && errno == ENOENT) {
+                       strlcpy(iface->leasefile, argv[optind],
+                           sizeof(iface->leasefile));
+                       iface->state->new = read_lease(iface);
+               }
                if (iface->state->new == NULL) {
                        if (errno == ENOENT)
                                syslog(LOG_ERR, "%s: no lease to dump",