From: Roy Marples Date: Tue, 9 Nov 2010 00:34:38 +0000 (+0000) Subject: Don't configure the interface twice. X-Git-Tag: v5.2.9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1422e8cd251c34e3abb190f83201909ab1d00ad;p=thirdparty%2Fdhcpcd.git Don't configure the interface twice. --- diff --git a/dhcpcd.c b/dhcpcd.c index 02a1fd29..4577f589 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -815,11 +815,14 @@ int select_profile(struct interface *iface, const char *profile) { struct if_options *ifo; + int ret; + ret = 0; ifo = read_config(cffile, iface->name, iface->ssid, profile); if (ifo == NULL) { syslog(LOG_DEBUG, "%s: no profile %s", iface->name, profile); - return -1; + ret = -1; + goto exit; } if (profile != NULL) { strlcpy(iface->state->profile, profile, @@ -830,8 +833,11 @@ select_profile(struct interface *iface, const char *profile) *iface->state->profile = '\0'; free_options(iface->state->options); iface->state->options = ifo; - configure_interface1(iface); - return 0; + +exit: + if (profile) + configure_interface1(iface); + return ret; } static void @@ -841,7 +847,6 @@ start_fallback(void *arg) iface = (struct interface *)arg; select_profile(iface, iface->state->options->fallback); - configure_interface1(iface); start_interface(iface); }