From: Roy Marples Date: Tue, 13 May 2008 14:37:01 +0000 (+0000) Subject: Fix a segfault and lease issue for no fork users. X-Git-Tag: v4.0.2~418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74657a182c5759fd206ccd38c82a72144044c52b;p=thirdparty%2Fdhcpcd.git Fix a segfault and lease issue for no fork users. --- diff --git a/client.c b/client.c index bcd3b643..960b6905 100644 --- a/client.c +++ b/client.c @@ -455,7 +455,7 @@ client_setup(struct if_state *state, const struct options *options) options->options & DHCPCD_REQUEST || options->options & DHCPCD_DAEMONISED)) { - if (!get_old_lease(state, options)) + if (get_old_lease(state, options) != 0) return -1; state->timeout = 0; diff --git a/configure.c b/configure.c index edfbc908..0590202b 100644 --- a/configure.c +++ b/configure.c @@ -353,6 +353,7 @@ configure_routes(struct interface *iface, const struct dhcp_message *dhcp, else if (!(options->options & DHCPCD_DAEMONISED)) { /* We can never have more than 255 / 4 routes, * so 3 chars is plently */ + printf("foo\n"); if (*skipp) *skipp++ = ','; skipp += snprintf(skipp, @@ -367,15 +368,16 @@ configure_routes(struct interface *iface, const struct dhcp_message *dhcp, iface->routes = nr; #ifdef THERE_IS_NO_FORK - if (*dhcpcd_skiproutes) - *skipp = '\0'; - else { - free(dhcpcd_skiproutes); - dhcpcd_skiproutes = NULL; + if (dhcpcd_skiproutes) { + if (*dhcpcd_skiproutes) + *skipp = '\0'; + else { + free(dhcpcd_skiproutes); + dhcpcd_skiproutes = NULL; + } } #endif - return retval; }