diff options
author | Cong Wang <amwang@redhat.com> | 2013-04-14 11:18:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-14 15:24:17 -0400 |
commit | f88c91ddba958e9a5dd4a5ee8c52a0faa790f586 (patch) | |
tree | 768a7f6c5fa6bffa41fd1602cb21f6b455d8eb48 | |
parent | 2e0cbf2cc2c9371f0aa198857d799175ffe231a6 (diff) |
ipv6: statically link register_inet6addr_notifier()
Tomas reported the following build error:
net/built-in.o: In function `ieee80211_unregister_hw':
(.text+0x10f0e1): undefined reference to `unregister_inet6addr_notifier'
net/built-in.o: In function `ieee80211_register_hw':
(.text+0x10f610): undefined reference to `register_inet6addr_notifier'
make: *** [vmlinux] Error 1
when built IPv6 as a module.
So we have to statically link these symbols.
Reported-by: Tomas Melin <tomas.melin@iki.fi>
Cc: Tomas Melin <tomas.melin@iki.fi>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: YOSHIFUJI Hidaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/addrconf.h | 1 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 24 | ||||
-rw-r--r-- | net/ipv6/addrconf_core.c | 19 |
3 files changed, 23 insertions, 21 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 40be2a0d8ae1..84a6440f1f19 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -199,6 +199,7 @@ extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, | |||
199 | /* Device notifier */ | 199 | /* Device notifier */ |
200 | extern int register_inet6addr_notifier(struct notifier_block *nb); | 200 | extern int register_inet6addr_notifier(struct notifier_block *nb); |
201 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); | 201 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); |
202 | extern int inet6addr_notifier_call_chain(unsigned long val, void *v); | ||
202 | 203 | ||
203 | extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, | 204 | extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, |
204 | struct ipv6_devconf *devconf); | 205 | struct ipv6_devconf *devconf); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index a459c4f5b769..dae802c0af7c 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -168,8 +168,6 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev, | |||
168 | static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr, | 168 | static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr, |
169 | struct net_device *dev); | 169 | struct net_device *dev); |
170 | 170 | ||
171 | static ATOMIC_NOTIFIER_HEAD(inet6addr_chain); | ||
172 | |||
173 | static struct ipv6_devconf ipv6_devconf __read_mostly = { | 171 | static struct ipv6_devconf ipv6_devconf __read_mostly = { |
174 | .forwarding = 0, | 172 | .forwarding = 0, |
175 | .hop_limit = IPV6_DEFAULT_HOPLIMIT, | 173 | .hop_limit = IPV6_DEFAULT_HOPLIMIT, |
@@ -837,7 +835,7 @@ out2: | |||
837 | rcu_read_unlock_bh(); | 835 | rcu_read_unlock_bh(); |
838 | 836 | ||
839 | if (likely(err == 0)) | 837 | if (likely(err == 0)) |
840 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_UP, ifa); | 838 | inet6addr_notifier_call_chain(NETDEV_UP, ifa); |
841 | else { | 839 | else { |
842 | kfree(ifa); | 840 | kfree(ifa); |
843 | ifa = ERR_PTR(err); | 841 | ifa = ERR_PTR(err); |
@@ -927,7 +925,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) | |||
927 | 925 | ||
928 | ipv6_ifa_notify(RTM_DELADDR, ifp); | 926 | ipv6_ifa_notify(RTM_DELADDR, ifp); |
929 | 927 | ||
930 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifp); | 928 | inet6addr_notifier_call_chain(NETDEV_DOWN, ifp); |
931 | 929 | ||
932 | /* | 930 | /* |
933 | * Purge or update corresponding prefix | 931 | * Purge or update corresponding prefix |
@@ -2988,7 +2986,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2988 | 2986 | ||
2989 | if (state != INET6_IFADDR_STATE_DEAD) { | 2987 | if (state != INET6_IFADDR_STATE_DEAD) { |
2990 | __ipv6_ifa_notify(RTM_DELADDR, ifa); | 2988 | __ipv6_ifa_notify(RTM_DELADDR, ifa); |
2991 | atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa); | 2989 | inet6addr_notifier_call_chain(NETDEV_DOWN, ifa); |
2992 | } | 2990 | } |
2993 | in6_ifa_put(ifa); | 2991 | in6_ifa_put(ifa); |
2994 | 2992 | ||
@@ -4869,22 +4867,6 @@ static struct pernet_operations addrconf_ops = { | |||
4869 | .exit = addrconf_exit_net, | 4867 | .exit = addrconf_exit_net, |
4870 | }; | 4868 | }; |
4871 | 4869 | ||
4872 | /* | ||
4873 | * Device notifier | ||
4874 | */ | ||
4875 | |||
4876 | int register_inet6addr_notifier(struct notifier_block *nb) | ||
4877 | { | ||
4878 | return atomic_notifier_chain_register(&inet6addr_chain, nb); | ||
4879 | } | ||
4880 | EXPORT_SYMBOL(register_inet6addr_notifier); | ||
4881 | |||
4882 | int unregister_inet6addr_notifier(struct notifier_block *nb) | ||
4883 | { | ||
4884 | return atomic_notifier_chain_unregister(&inet6addr_chain, nb); | ||
4885 | } | ||
4886 | EXPORT_SYMBOL(unregister_inet6addr_notifier); | ||
4887 | |||
4888 | static struct rtnl_af_ops inet6_ops = { | 4870 | static struct rtnl_af_ops inet6_ops = { |
4889 | .family = AF_INET6, | 4871 | .family = AF_INET6, |
4890 | .fill_link_af = inet6_fill_link_af, | 4872 | .fill_link_af = inet6_fill_link_af, |
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c index d051e5f4bf34..72104562c864 100644 --- a/net/ipv6/addrconf_core.c +++ b/net/ipv6/addrconf_core.c | |||
@@ -78,3 +78,22 @@ int __ipv6_addr_type(const struct in6_addr *addr) | |||
78 | } | 78 | } |
79 | EXPORT_SYMBOL(__ipv6_addr_type); | 79 | EXPORT_SYMBOL(__ipv6_addr_type); |
80 | 80 | ||
81 | static ATOMIC_NOTIFIER_HEAD(inet6addr_chain); | ||
82 | |||
83 | int register_inet6addr_notifier(struct notifier_block *nb) | ||
84 | { | ||
85 | return atomic_notifier_chain_register(&inet6addr_chain, nb); | ||
86 | } | ||
87 | EXPORT_SYMBOL(register_inet6addr_notifier); | ||
88 | |||
89 | int unregister_inet6addr_notifier(struct notifier_block *nb) | ||
90 | { | ||
91 | return atomic_notifier_chain_unregister(&inet6addr_chain, nb); | ||
92 | } | ||
93 | EXPORT_SYMBOL(unregister_inet6addr_notifier); | ||
94 | |||
95 | int inet6addr_notifier_call_chain(unsigned long val, void *v) | ||
96 | { | ||
97 | return atomic_notifier_call_chain(&inet6addr_chain, val, v); | ||
98 | } | ||
99 | EXPORT_SYMBOL(inet6addr_notifier_call_chain); | ||