From: Roy Marples Date: Tue, 24 Aug 2010 10:36:20 +0000 (+0000) Subject: Allow interface to also be a path to a DHCP wire formatted file. X-Git-Tag: v5.2.9~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb90edf46fc3d000ac31fe207a9c2ed4887350b0;p=thirdparty%2Fdhcpcd.git Allow interface to also be a path to a DHCP wire formatted file. --- diff --git a/dhcpcd.8.in b/dhcpcd.8.in index b966746b..31796ea9 100644 --- a/dhcpcd.8.in +++ b/dhcpcd.8.in @@ -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 . diff --git a/dhcpcd.c b/dhcpcd.c index 07e68ed4..1678e5eb 100644 --- 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",