diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2017-03-12 10:19:34 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2017-04-12 22:02:36 +0200 |
commit | be054fc830ff70aced3533fffc6b851fa604d241 (patch) | |
tree | 64d6d07bf211948a2956909f91c2d52094ff1586 /net/6lowpan | |
parent | c259d1413b195c57e708f324eed41668a37ba6ec (diff) |
6lowpan: Set MAC address length according to LOWPAN_LLTYPE
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 <patrik.flykt@linux.intel.com>
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan')
-rw-r--r-- | net/6lowpan/core.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c index 5945f7e19c67..5f9909a2b58c 100644 --- a/net/6lowpan/core.c +++ b/net/6lowpan/core.c @@ -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; |