Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: export several functions

This patch exports some neighbour discovery functions which can be used
by 6lowpan neighbour discovery ops functionality then.

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: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.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>

authored by

Alexander Aring and committed by
David S. Miller
cc84b3c6 f997c55c

+29 -19
+7
include/net/addrconf.h
··· 97 97 void addrconf_add_linklocal(struct inet6_dev *idev, 98 98 const struct in6_addr *addr, u32 flags); 99 99 100 + int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev, 101 + const struct prefix_info *pinfo, 102 + struct inet6_dev *in6_dev, 103 + const struct in6_addr *addr, int addr_type, 104 + u32 addr_flags, bool sllao, bool tokenized, 105 + __u32 valid_lft, u32 prefered_lft); 106 + 100 107 static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev) 101 108 { 102 109 if (dev->addr_len != ETH_ALEN)
+12
include/net/ndisc.h
··· 53 53 54 54 #include <net/neighbour.h> 55 55 56 + /* Set to 3 to get tracing... */ 57 + #define ND_DEBUG 1 58 + 59 + #define ND_PRINTK(val, level, fmt, ...) \ 60 + do { \ 61 + if (val <= ND_DEBUG) \ 62 + net_##level##_ratelimited(fmt, ##__VA_ARGS__); \ 63 + } while (0) 64 + 56 65 struct ctl_table; 57 66 struct inet6_dev; 58 67 struct net_device; ··· 123 114 struct ndisc_options *ndisc_parse_options(const struct net_device *dev, 124 115 u8 *opt, int opt_len, 125 116 struct ndisc_options *ndopts); 117 + 118 + void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, 119 + int data_len, int pad); 126 120 127 121 #define NDISC_OPS_REDIRECT_DATA_SPACE 2 128 122
+7 -8
net/ipv6/addrconf.c
··· 2333 2333 idev->addr_gen_mode == IN6_ADDR_GEN_MODE_RANDOM; 2334 2334 } 2335 2335 2336 - static int addrconf_prefix_rcv_add_addr(struct net *net, 2337 - struct net_device *dev, 2338 - const struct prefix_info *pinfo, 2339 - struct inet6_dev *in6_dev, 2340 - const struct in6_addr *addr, 2341 - int addr_type, u32 addr_flags, 2342 - bool sllao, bool tokenized, 2343 - __u32 valid_lft, u32 prefered_lft) 2336 + int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev, 2337 + const struct prefix_info *pinfo, 2338 + struct inet6_dev *in6_dev, 2339 + const struct in6_addr *addr, int addr_type, 2340 + u32 addr_flags, bool sllao, bool tokenized, 2341 + __u32 valid_lft, u32 prefered_lft) 2344 2342 { 2345 2343 struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1); 2346 2344 int create = 0, update_lft = 0; ··· 2428 2430 2429 2431 return 0; 2430 2432 } 2433 + EXPORT_SYMBOL_GPL(addrconf_prefix_rcv_add_addr); 2431 2434 2432 2435 void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao) 2433 2436 {
+3 -11
net/ipv6/ndisc.c
··· 73 73 #include <linux/netfilter.h> 74 74 #include <linux/netfilter_ipv6.h> 75 75 76 - /* Set to 3 to get tracing... */ 77 - #define ND_DEBUG 1 78 - 79 - #define ND_PRINTK(val, level, fmt, ...) \ 80 - do { \ 81 - if (val <= ND_DEBUG) \ 82 - net_##level##_ratelimited(fmt, ##__VA_ARGS__); \ 83 - } while (0) 84 - 85 76 static u32 ndisc_hash(const void *pkey, 86 77 const struct net_device *dev, 87 78 __u32 *hash_rnd); ··· 141 150 }; 142 151 EXPORT_SYMBOL_GPL(nd_tbl); 143 152 144 - static void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, 145 - int data_len, int pad) 153 + void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, 154 + int data_len, int pad) 146 155 { 147 156 int space = __ndisc_opt_addr_space(data_len, pad); 148 157 u8 *opt = skb_put(skb, space); ··· 161 170 if (space > 0) 162 171 memset(opt, 0, space); 163 172 } 173 + EXPORT_SYMBOL_GPL(__ndisc_fill_addr_option); 164 174 165 175 static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type, 166 176 void *data, u8 icmp6_type)