mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-12-18 06:13:30 +08:00
Allow interface to also be a path to a DHCP wire formatted file.
This commit is contained in:
parent
0e07d2a3e5
commit
cb90edf46f
@ -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 .
|
||||
|
5
dhcpcd.c
5
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",
|
||||
|
Loading…
Reference in New Issue
Block a user