Skip to content

Commit 5a25d0c

Browse files
committed
fixup! net/gnrc_netif: add gnrc_netif_up()/gnrc_netif_down()
1 parent 8882777 commit 5a25d0c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sys/net/gnrc/netif/gnrc_netif.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,10 +1465,19 @@ static int _change_state_and_wait(gnrc_netif_t *netif, netopt_state_t state, uns
14651465
{
14661466
int res = 0;
14671467
#if IS_USED(MODULE_GNRC_NETIF_BUS)
1468+
gnrc_netif_event_t event;
1469+
1470+
if ((state == NETOPT_STATE_SLEEP) || (state == NETOPT_STATE_OFF) ||
1471+
(state == NETOPT_STATE_STANDBY)) {
1472+
event = GNRC_NETIF_EVENT_LINK_STATE_CHANGED_DOWN;
1473+
} else {
1474+
event = GNRC_NETIF_EVENT_LINK_STATE_CHANGED_UP;
1475+
}
1476+
14681477
msg_bus_entry_t sub;
14691478
msg_bus_t *bus = gnrc_netif_get_bus(netif, GNRC_NETIF_BUS_IFACE);
14701479
msg_bus_attach(bus, &sub);
1471-
msg_bus_subscribe(&sub, GNRC_IPV6_EVENT_ADDR_VALID);
1480+
msg_bus_subscribe(&sub, event);
14721481
#endif
14731482

14741483
while (gnrc_netapi_set(netif->pid, NETOPT_STATE, 0, &state, sizeof(state)) == -EBUSY) {}

0 commit comments

Comments
 (0)