mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/shell/gnrc_netif: Set lwIP netif state on up/down
This commit is contained in:
parent
c49cd446a8
commit
726e2eb045
@ -1684,10 +1684,17 @@ static uint8_t _get_prefix_len(char *addr)
|
||||
|
||||
static int _netif_link(netif_t *iface, netopt_enable_t en)
|
||||
{
|
||||
#if IS_USED(MODULE_LWIP_NETIF) /* lwIP sets netif state, not link state */
|
||||
if (netif_set_opt(iface, NETOPT_ACTIVE, 0, &en, sizeof(en)) < 0) {
|
||||
printf("error: unable to set state %s\n", en == NETOPT_ENABLE ? "up" : "down");
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
if (netif_set_opt(iface, NETOPT_LINK, 0, &en, sizeof(en)) < 0) {
|
||||
printf("error: unable to set link %s\n", en == NETOPT_ENABLE ? "up" : "down");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user