Skip to content

Commit

Permalink
gnrc_netif2: adapt setting of maximum packet size for slipdev
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Nov 14, 2017
1 parent 6d124d5 commit e51b0c1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sys/net/gnrc/netif2/gnrc_netif2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,10 +1100,15 @@ 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
}
_update_l2addr_from_dev(netif);
Expand Down

0 comments on commit e51b0c1

Please sign in to comment.