diff options
author | alex.bluesman.smirnov@gmail.com <alex.bluesman.smirnov@gmail.com> | 2012-07-01 15:58:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-05 06:11:15 -0400 |
commit | 42c3629551ab8b1613d27c8d046537f9f5b17cbb (patch) | |
tree | 2041ebbd192bf75af061c36cd8385f152b6624fb /net | |
parent | 0979e465c5ab205b63a1c1820fe833f396a120f0 (diff) |
6lowpan: revert 'reuse eth_mac_addr()'
This reverts the commit cdf49c283e2e105da86ca575ad35b453f5ff24ea which
replaces lowpan '.ndo_set_mac_address' method by ethernet's one.
Accorind to the IEEE 802.15.4 standard, device has 8-byte length address,
so this hook loses the last 2 bytes which may rise a compatibility problems
with other IEEE 802.15.4 standard implementations.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ieee802154/6lowpan.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c index cd5007f3a569..f4070e54d1a1 100644 --- a/net/ieee802154/6lowpan.c +++ b/net/ieee802154/6lowpan.c | |||
@@ -55,7 +55,6 @@ | |||
55 | #include <linux/module.h> | 55 | #include <linux/module.h> |
56 | #include <linux/moduleparam.h> | 56 | #include <linux/moduleparam.h> |
57 | #include <linux/netdevice.h> | 57 | #include <linux/netdevice.h> |
58 | #include <linux/etherdevice.h> | ||
59 | #include <net/af_ieee802154.h> | 58 | #include <net/af_ieee802154.h> |
60 | #include <net/ieee802154.h> | 59 | #include <net/ieee802154.h> |
61 | #include <net/ieee802154_netdev.h> | 60 | #include <net/ieee802154_netdev.h> |
@@ -936,6 +935,19 @@ drop: | |||
936 | return -EINVAL; | 935 | return -EINVAL; |
937 | } | 936 | } |
938 | 937 | ||
938 | static int lowpan_set_address(struct net_device *dev, void *p) | ||
939 | { | ||
940 | struct sockaddr *sa = p; | ||
941 | |||
942 | if (netif_running(dev)) | ||
943 | return -EBUSY; | ||
944 | |||
945 | /* TODO: validate addr */ | ||
946 | memcpy(dev->dev_addr, sa->sa_data, dev->addr_len); | ||
947 | |||
948 | return 0; | ||
949 | } | ||
950 | |||
939 | static int lowpan_get_mac_header_length(struct sk_buff *skb) | 951 | static int lowpan_get_mac_header_length(struct sk_buff *skb) |
940 | { | 952 | { |
941 | /* | 953 | /* |
@@ -1078,7 +1090,7 @@ static struct header_ops lowpan_header_ops = { | |||
1078 | 1090 | ||
1079 | static const struct net_device_ops lowpan_netdev_ops = { | 1091 | static const struct net_device_ops lowpan_netdev_ops = { |
1080 | .ndo_start_xmit = lowpan_xmit, | 1092 | .ndo_start_xmit = lowpan_xmit, |
1081 | .ndo_set_mac_address = eth_mac_addr, | 1093 | .ndo_set_mac_address = lowpan_set_address, |
1082 | }; | 1094 | }; |
1083 | 1095 | ||
1084 | static struct ieee802154_mlme_ops lowpan_mlme = { | 1096 | static struct ieee802154_mlme_ops lowpan_mlme = { |