diff options
author | Alexander Aring <aar@pengutronix.de> | 2016-06-15 15:20:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-15 23:41:23 -0400 |
commit | cc84b3c6b48ae81748c5e25d3558872385196162 (patch) | |
tree | d21f368e427a3eddaacf7aa871309fe8d4c17d5f /net/ipv6 | |
parent | f997c55c1dc8841b3ee4df0493d0ac7966d42165 (diff) |
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>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 15 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 14 |
2 files changed, 10 insertions, 19 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index b6e9bdc610f2..6c8fc3f96b11 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2333,14 +2333,12 @@ static bool is_addr_mode_generate_stable(struct inet6_dev *idev) | |||
2333 | idev->addr_gen_mode == IN6_ADDR_GEN_MODE_RANDOM; | 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, | 2336 | int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev, |
2337 | struct net_device *dev, | 2337 | const struct prefix_info *pinfo, |
2338 | const struct prefix_info *pinfo, | 2338 | struct inet6_dev *in6_dev, |
2339 | struct inet6_dev *in6_dev, | 2339 | const struct in6_addr *addr, int addr_type, |
2340 | const struct in6_addr *addr, | 2340 | u32 addr_flags, bool sllao, bool tokenized, |
2341 | int addr_type, u32 addr_flags, | 2341 | __u32 valid_lft, u32 prefered_lft) |
2342 | bool sllao, bool tokenized, | ||
2343 | __u32 valid_lft, u32 prefered_lft) | ||
2344 | { | 2342 | { |
2345 | struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1); | 2343 | struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1); |
2346 | int create = 0, update_lft = 0; | 2344 | int create = 0, update_lft = 0; |
@@ -2430,6 +2428,7 @@ static int addrconf_prefix_rcv_add_addr(struct net *net, | |||
2430 | 2428 | ||
2431 | return 0; | 2429 | return 0; |
2432 | } | 2430 | } |
2431 | EXPORT_SYMBOL_GPL(addrconf_prefix_rcv_add_addr); | ||
2433 | 2432 | ||
2434 | void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao) | 2433 | void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao) |
2435 | { | 2434 | { |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 2f4afd17954b..fe65cdc28a45 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -73,15 +73,6 @@ | |||
73 | #include <linux/netfilter.h> | 73 | #include <linux/netfilter.h> |
74 | #include <linux/netfilter_ipv6.h> | 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 | static u32 ndisc_hash(const void *pkey, | 76 | static u32 ndisc_hash(const void *pkey, |
86 | const struct net_device *dev, | 77 | const struct net_device *dev, |
87 | __u32 *hash_rnd); | 78 | __u32 *hash_rnd); |
@@ -150,8 +141,8 @@ struct neigh_table nd_tbl = { | |||
150 | }; | 141 | }; |
151 | EXPORT_SYMBOL_GPL(nd_tbl); | 142 | EXPORT_SYMBOL_GPL(nd_tbl); |
152 | 143 | ||
153 | static void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, | 144 | void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, |
154 | int data_len, int pad) | 145 | int data_len, int pad) |
155 | { | 146 | { |
156 | int space = __ndisc_opt_addr_space(data_len, pad); | 147 | int space = __ndisc_opt_addr_space(data_len, pad); |
157 | u8 *opt = skb_put(skb, space); | 148 | u8 *opt = skb_put(skb, space); |
@@ -170,6 +161,7 @@ static void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, | |||
170 | if (space > 0) | 161 | if (space > 0) |
171 | memset(opt, 0, space); | 162 | memset(opt, 0, space); |
172 | } | 163 | } |
164 | EXPORT_SYMBOL_GPL(__ndisc_fill_addr_option); | ||
173 | 165 | ||
174 | static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type, | 166 | static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type, |
175 | void *data, u8 icmp6_type) | 167 | void *data, u8 icmp6_type) |