"%s: found %s on hardware address %s",
ifp->name, inet_ntoa(ina), hwaddr);
if (select_profile(ifp, hwaddr) == -1 &&
- errno == ENOENT)
- select_profile(ifp, inet_ntoa(ina));
+ select_profile(ifp, inet_ntoa(ina)) == -1)
+ {
+ state->probes = 0;
+ /* We didn't find a profile for this
+ * address or hwaddr, so move to the next
+ * arping profile */
+ if (state->arping_index <
+ ifp->options->arping_len)
+ {
+ arp_probe(ifp);
+ return;
+ }
+ }
dhcp_close(ifp);
eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
start_interface(ifp);
select_profile(struct interface *ifp, const char *profile)
{
struct if_options *ifo;
- int ret;
- ret = 0;
ifo = read_config(ifp->ctx, ifp->name, ifp->ssid, profile);
if (ifo == NULL) {
syslog(LOG_DEBUG, "%s: no profile %s", ifp->name, profile);
- ret = -1;
- goto exit;
+ return -1;
}
if (profile != NULL) {
strlcpy(ifp->profile, profile, sizeof(ifp->profile));
*ifp->profile = '\0';
free_options(ifp->options);
ifp->options = ifo;
-
-exit:
if (profile)
configure_interface1(ifp);
- return ret;
+ return 1;
}
static void