diff options
author | 2005-07-16 18:38:45 +0000 | |
---|---|---|
committer | 2005-07-16 18:38:45 +0000 | |
commit | 0a5f7f787b01a784d24ffba25dee2e88865b600c (patch) | |
tree | cef3c072ce94866d675131c8f1843e0aa6868cc8 | |
parent | remove braces here too (diff) | |
download | wireguard-openbsd-0a5f7f787b01a784d24ffba25dee2e88865b600c.tar.xz wireguard-openbsd-0a5f7f787b01a784d24ffba25dee2e88865b600c.zip |
Rejig struct string_list to use char array rather than char pointer, and
eliminate new_parse_string. alloc.c becomes redundant. Junk a couple of
unused fields (env, envc) in struct client_state.
suggestions by & ok millert@
-rw-r--r-- | sbin/dhclient/Makefile | 4 | ||||
-rw-r--r-- | sbin/dhclient/clparse.c | 4 | ||||
-rw-r--r-- | sbin/dhclient/dhcpd.h | 9 |
3 files changed, 6 insertions, 11 deletions
diff --git a/sbin/dhclient/Makefile b/sbin/dhclient/Makefile index 4dfad35e18d..797dc17a3af 100644 --- a/sbin/dhclient/Makefile +++ b/sbin/dhclient/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.10 2005/07/11 18:09:09 krw Exp $ +# $OpenBSD: Makefile,v 1.11 2005/07/16 18:38:45 krw Exp $ # # Copyright (c) 1996, 1997 The Internet Software Consortium. # All rights reserved. @@ -32,7 +32,7 @@ .include <bsd.own.mk> -SRCS= dhclient.c clparse.c alloc.c dispatch.c bpf.c options.c \ +SRCS= dhclient.c clparse.c dispatch.c bpf.c options.c \ tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \ parse.c privsep.c diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c index a67ea80e0a8..29eb1a735fe 100644 --- a/sbin/dhclient/clparse.c +++ b/sbin/dhclient/clparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clparse.c,v 1.24 2005/07/16 14:09:51 krw Exp $ */ +/* $OpenBSD: clparse.c,v 1.25 2005/07/16 18:38:45 krw Exp $ */ /* Parser for dhclient config and lease files... */ @@ -835,7 +835,7 @@ parse_string_list(FILE *cfile, struct string_list **lp, int multiple) return; } - tmp = new_string_list(strlen(val) + 1); + tmp = malloc(sizeof(struct string_list) + strlen(val)); if (tmp == NULL) error("no memory for string list entry."); strlcpy(tmp->string, val, strlen(val) + 1); diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index 43ecb8d4556..a57d499a319 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.43 2005/07/16 14:09:51 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.44 2005/07/16 18:38:45 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@openbsd.org> @@ -83,7 +83,7 @@ struct option_data { struct string_list { struct string_list *next; - char *string; + char string[1]; /* Actually bigger. */ }; struct iaddr { @@ -183,8 +183,6 @@ struct client_state { struct client_config *config; char **scriptEnv; int scriptEnvsize; - struct string_list *env; - int envc; }; struct interface_info { @@ -266,9 +264,6 @@ time_t parse_date(FILE *); /* tree.c */ pair cons(caddr_t, pair); -/* alloc.c */ -struct string_list *new_string_list(size_t size); - /* bpf.c */ int if_register_bpf(struct interface_info *); void if_register_send(struct interface_info *); |