changeset 2472:bf549b4eec69 draft

Fix new dhcp environment options
author Roy Marples <roy@marples.name>
date Mon, 05 May 2014 20:18:14 +0000
parents 4b8bdeacc5a2
children 3a21f982379d
files dhcp.c script.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp.c	Sun May 04 22:48:43 2014 +0000
+++ b/dhcp.c	Mon May 05 20:18:14 2014 +0000
@@ -1158,7 +1158,7 @@
 	ifo = ifp->options;
 	get_option_uint8(ifp->ctx, &overl, dhcp, DHO_OPTIONSOVERLOADED);
 
-	if (!env) {
+	if (env == NULL) {
 		if (dhcp->yiaddr || dhcp->ciaddr)
 			e += 5;
 		if (*dhcp->bootfile && !(overl & 1))
--- a/script.c	Sun May 04 22:48:43 2014 +0000
+++ b/script.c	Mon May 05 20:18:14 2014 +0000
@@ -408,7 +408,7 @@
 #ifdef INET
 	if (dhcp && state && state->new) {
 		n = dhcp_env(NULL, NULL, state->new, ifp);
-		if (e > 0) {
+		if (n > 0) {
 			nenv = realloc(env, sizeof(char *) *
 			    (elen + (size_t)n + 1));
 			if (nenv == NULL)