diff mbox

[v3,2/5] 6lowpan: Set MAC address lenght according to LOWPAN_LLTYPE

Message ID 20170217155003.4594-3-luiz.dentz@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Luiz Augusto von Dentz Feb. 17, 2017, 3:50 p.m. UTC
From: Patrik Flykt <patrik.flykt@linux.intel.com>

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>
---
 net/6lowpan/core.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Stefan Schmidt Feb. 20, 2017, 9:58 p.m. UTC | #1
Hello.

lenght typo in subject line.

On 02/17/2017 04:50 PM, Luiz Augusto von Dentz wrote:
> From: Patrik Flykt <patrik.flykt@linux.intel.com>
>
> 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>
> ---
>  net/6lowpan/core.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
> index 5945f7e..5f9909a 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;
>

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>

regards
Stefan Schmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
index 5945f7e..5f9909a 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;