Skip to content

Commit

Permalink
6lowpan: Set MAC address length according to LOWPAN_LLTYPE
Browse files Browse the repository at this point in the history
Set MAC address length according to the 6LoWPAN link layer in use.
Bluetooth Low Energy uses 48 bit addressing while IEEE802.15.4 uses
64 bits.

Signed-off-by: Patrik Flykt <[email protected]>
Reviewed-by: Stefan Schmidt <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
pfl authored and holtmann committed Apr 12, 2017
1 parent c259d14 commit be054fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion net/6lowpan/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ int lowpan_register_netdevice(struct net_device *dev,
{
int i, ret;

dev->addr_len = EUI64_ADDR_LEN;
switch (lltype) {
case LOWPAN_LLTYPE_IEEE802154:
dev->addr_len = EUI64_ADDR_LEN;
break;

case LOWPAN_LLTYPE_BTLE:
dev->addr_len = ETH_ALEN;
break;
}

dev->type = ARPHRD_6LOWPAN;
dev->mtu = IPV6_MIN_MTU;
dev->priv_flags |= IFF_NO_QUEUE;
Expand Down

0 comments on commit be054fc

Please sign in to comment.