diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-08-13 14:10:27 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2018-08-13 14:10:27 +0000 |
commit | 8407d5d118065e24be6a9d1a07b323359fa7258d (patch) | |
tree | 0e6c2c54d40991ed9b0b707debc41f06f5a5c80c /sbin | |
parent | ccc6ee5134aa61655ee0b435db6c07a07ac7f728 (diff) |
The iterator i is not the option code, but simply the index for the
array that stores the option codes. Fixes the issue where it named
an incorrect option on error.
Found by Florian Kaiser
ok krw@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 7dfbe8d7774..b7762c763e9 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.575 2018/06/20 12:10:46 sthen Exp $ */ +/* $OpenBSD: dhclient.c,v 1.576 2018/08/13 14:10:26 patrick Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -1230,7 +1230,7 @@ packet_to_lease(struct interface_info *ifi, struct option_data *options) */ for (i = 0; i < config->required_option_count; i++) { if (lease->options[config->required_options[i]].len == 0) { - name = code_to_name(i); + name = code_to_name(config->required_options[i]); log_warnx("%s: %s required but missing", log_procname, name); goto decline; |