Implement the "showdown" setting

This allows hiding the interfaces disabled. It is enabled by default on
embedded platforms.
This commit is contained in:
Pierre Pronchery 2015-09-04 19:21:35 +02:00
parent a9fbf02f2d
commit 0dceb00ea9

View File

@ -235,6 +235,14 @@ static int _refresh_interface_add(Network * network, char const * name,
return 1;
}
#endif
if((flags & IFF_UP) == 0)
{
q = network->helper->config_get(network->helper->panel,
"network", "showdown");
if(q != NULL && strtol(q, NULL, 10) == 0)
/* ignore the interface */
return 1;
}
if((p = realloc(network->interfaces, sizeof(*p)
* (network->interfaces_cnt + 1)))
== NULL)