From: Roy Marples Date: Mon, 5 May 2014 20:18:14 +0000 (+0000) Subject: Fix new dhcp environment options X-Git-Tag: v6.4.0~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=994457f6dde5e53af678026c1829f0a66fc82a5e;p=thirdparty%2Fdhcpcd.git Fix new dhcp environment options --- diff --git a/dhcp.c b/dhcp.c index 0ad78734..272e926b 100644 --- a/dhcp.c +++ b/dhcp.c @@ -1158,7 +1158,7 @@ dhcp_env(char **env, const char *prefix, const struct dhcp_message *dhcp, 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)) diff --git a/script.c b/script.c index ca8a455c..bee200c4 100644 --- a/script.c +++ b/script.c @@ -408,7 +408,7 @@ dumplease: #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)