summaryrefslogtreecommitdiff
path: root/sbin/dhclient/options.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-10-27 23:08:54 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-10-27 23:08:54 +0000
commitab511a5cc56acdc5f723411098bb1ead3075d5e0 (patch)
treef2b7a926be0d01090db6ecefa3a25802daf72897 /sbin/dhclient/options.c
parenta4f754ad67aa4517d148b7f5a0a2a60e6ec6243e (diff)
Change dhclient.conf directive 'ignore' to take a list of option names
rather than list of option declarations. e.g. 'ignore routers;' instead of 'ignore routers 1.2.3.4;' The value in the declaration was being ignored anyway. While there clean up the related code a bit.
Diffstat (limited to 'sbin/dhclient/options.c')
-rw-r--r--sbin/dhclient/options.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c
index 6d2eb78c76b..0d635a51486 100644
--- a/sbin/dhclient/options.c
+++ b/sbin/dhclient/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.41 2012/06/26 14:46:42 krw Exp $ */
+/* $OpenBSD: options.c,v 1.42 2012/10/27 23:08:53 krw Exp $ */
/* DHCP options parsing and reassembly. */
@@ -198,14 +198,16 @@ cons_options(struct option_data *options)
* Format the specified option so that a human can easily read it.
*/
char *
-pretty_print_option(unsigned int code, unsigned char *data, int len,
- int emit_commas, int emit_quotes)
+pretty_print_option(unsigned int code, struct option_data *option,
+ int emit_punct)
{
static char optbuf[32768]; /* XXX */
int hunksize = 0, numhunk = -1, numelem = 0;
char fmtbuf[32], *op = optbuf;
int i, j, k, opleft = sizeof(optbuf);
+ unsigned char *data = option->data;
unsigned char *dp = data;
+ int len = option->len;
struct in_addr foo;
char comma;
@@ -213,7 +215,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
if (code > 255)
error("pretty_print_option: bad code %d", code);
- if (emit_commas)
+ if (emit_punct)
comma = ',';
else
comma = ' ';
@@ -316,7 +318,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
size_t oplen;
switch (fmtbuf[j]) {
case 't':
- if (emit_quotes) {
+ if (emit_punct) {
*op++ = '"';
opleft--;
}
@@ -345,7 +347,7 @@ pretty_print_option(unsigned int code, unsigned char *data, int len,
opleft--;
}
}
- if (emit_quotes) {
+ if (emit_punct) {
*op++ = '"';
opleft--;
}