aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-01-20 02:37:53 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-20 19:59:34 -0500
commitf2eda47df46f9953fc8a4fec820f34d539a8efbb (patch)
tree3f4a745c93f44a0375d85c96b284bff5d3b4e640 /net/ipv6
parent6193d2be290990b789021e06fa770ecb45319f2d (diff)
ipv6: raw: rcu annotations
Remove sparse warnings, using a function typedef to be able to use __rcu annotation on mh_filter pointer. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/raw.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 86c39526ba5e..2bc6cd7bb8ec 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -123,18 +123,18 @@ static __inline__ int icmpv6_filter(struct sock *sk, struct sk_buff *skb)
123} 123}
124 124
125#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 125#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
126static int (*mh_filter)(struct sock *sock, struct sk_buff *skb); 126typedef int mh_filter_t(struct sock *sock, struct sk_buff *skb);
127 127
128int rawv6_mh_filter_register(int (*filter)(struct sock *sock, 128static mh_filter_t __rcu *mh_filter __read_mostly;
129 struct sk_buff *skb)) 129
130int rawv6_mh_filter_register(mh_filter_t filter)
130{ 131{
131 rcu_assign_pointer(mh_filter, filter); 132 rcu_assign_pointer(mh_filter, filter);
132 return 0; 133 return 0;
133} 134}
134EXPORT_SYMBOL(rawv6_mh_filter_register); 135EXPORT_SYMBOL(rawv6_mh_filter_register);
135 136
136int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock, 137int rawv6_mh_filter_unregister(mh_filter_t filter)
137 struct sk_buff *skb))
138{ 138{
139 rcu_assign_pointer(mh_filter, NULL); 139 rcu_assign_pointer(mh_filter, NULL);
140 synchronize_rcu(); 140 synchronize_rcu();
@@ -192,10 +192,10 @@ static int ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
192 * policy is placed in rawv6_rcv() because it is 192 * policy is placed in rawv6_rcv() because it is
193 * required for each socket. 193 * required for each socket.
194 */ 194 */
195 int (*filter)(struct sock *sock, struct sk_buff *skb); 195 mh_filter_t *filter;
196 196
197 filter = rcu_dereference(mh_filter); 197 filter = rcu_dereference(mh_filter);
198 filtered = filter ? filter(sk, skb) : 0; 198 filtered = filter ? (*filter)(sk, skb) : 0;
199 break; 199 break;
200 } 200 }
201#endif 201#endif