mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 22:13:52 +01:00
gnrc/lorawan: fix netopt_state_t size in link_layer
`netopt_state_t` is an enumeration type which is not necessarily 1 byte. If `uint8_t` is used, the cast `*((const netopt_state_t*) val` in `sx127x_netdev::_set`tries to read the real size, which can be more than the given length of 1 byte. Therefore, `netstat_opt_t` has to be used instead of `uint8_t`
This commit is contained in:
parent
95f34e00b9
commit
32c78e3317
@ -143,7 +143,7 @@ void gnrc_lorawan_open_rx_window(gnrc_lorawan_t *mac)
|
||||
if (mac->state == LORAWAN_STATE_RX_1) {
|
||||
xtimer_set_msg(&mac->rx, _DRIFT_FACTOR, &mac->msg, thread_getpid());
|
||||
}
|
||||
uint8_t state = NETOPT_STATE_RX;
|
||||
netopt_state_t state = NETOPT_STATE_RX;
|
||||
dev->driver->set(dev, NETOPT_STATE, &state, sizeof(state));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user