net: lib: config: Timeout when network interface is down
If the network interface is down, we should timeout properly and let the application to handle the situation. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
1ada829ca3
commit
077b52c6f8
1 changed files with 9 additions and 1 deletions
|
@ -376,6 +376,14 @@ int net_config_init(const char *app_info, u32_t flags, s32_t timeout)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count == 0) {
|
||||||
|
/* Network interface did not come up. We will not try
|
||||||
|
* to setup things in that case.
|
||||||
|
*/
|
||||||
|
NET_ERR("Timeout while waiting network %s", "interface");
|
||||||
|
return -ENETDOWN;
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & NET_CONFIG_NEED_IPV6) {
|
if (flags & NET_CONFIG_NEED_IPV6) {
|
||||||
need++;
|
need++;
|
||||||
}
|
}
|
||||||
|
@ -402,7 +410,7 @@ int net_config_init(const char *app_info, u32_t flags, s32_t timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!count && timeout) {
|
if (!count && timeout) {
|
||||||
NET_ERR("Timeout while waiting setup");
|
NET_ERR("Timeout while waiting network %s", "setup");
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue