1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_netif2: adapt setting of maximum packet size for slipdev

This commit is contained in:
Martine Lenders 2017-11-14 22:46:24 +01:00
parent 6038a7d3a5
commit 852cb5a791
No known key found for this signature in database
GPG Key ID: 8E97A9FE55F25D62

View File

@ -1100,11 +1100,17 @@ static void _init_from_device(gnrc_netif2_t *netif)
break;
#endif
default:
res = dev->driver->get(dev, NETOPT_MAX_PACKET_SIZE, &tmp, sizeof(tmp));
assert(res == sizeof(tmp));
#ifdef MODULE_GNRC_IPV6
netif->ipv6.mtu = tmp;
res = dev->driver->get(dev, NETOPT_MAX_PACKET_SIZE, &tmp, sizeof(tmp));
if (res < 0) {
/* assume maximum possible transition unit */
netif->ipv6.mtu = UINT16_MAX;
}
else {
netif->ipv6.mtu = tmp;
}
#endif
break;
}
_update_l2addr_from_dev(netif);
}