diff options
author | Alexander Aring <aar@pengutronix.de> | 2016-06-15 21:20:17 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-15 20:41:22 -0700 |
commit | 2ad3ed59198c5404c34515cfcfd9a2b3c54d964f (patch) | |
tree | 0dd9cbc8f4787819d70afd97ff91256f70d4ccc7 /include | |
parent | 8626a0c83b0d471d859bcd908d016874df951fc3 (diff) |
6lowpan: add 802.15.4 short addr slaac
This patch adds the autoconfiguration if a valid 802.15.4 short address
is available for 802.15.4 6LoWPAN interfaces.
Cc: David S. Miller <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <aar@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/6lowpan.h | 6 | ||||
-rw-r--r-- | include/net/addrconf.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h index 2d9b9d39221e..5ab4c9901ccc 100644 --- a/include/net/6lowpan.h +++ b/include/net/6lowpan.h @@ -254,6 +254,12 @@ static inline bool lowpan_fetch_skb(struct sk_buff *skb, void *data, return false; } +static inline bool lowpan_802154_is_valid_src_short_addr(__le16 addr) +{ + /* First bit of addr is multicast, reserved or 802.15.4 specific */ + return !(addr & cpu_to_le16(0x8000)); +} + static inline void lowpan_push_hc_data(u8 **hc_ptr, const void *data, const size_t len) { diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 730d856683e5..b1774eb03f37 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -94,6 +94,9 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2, void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); +void addrconf_add_linklocal(struct inet6_dev *idev, + const struct in6_addr *addr, u32 flags); + static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev) { if (dev->addr_len != ETH_ALEN) |