#include <linux/export.h>
#include <linux/icmpv6.h>
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>

#include <net/ipv6.h>

#if IS_ENABLED(CONFIG_IPV6)

static ip6_icmp_send_t __rcu *ip6_icmp_send;

int inet6_register_icmp_sender(ip6_icmp_send_t *fn)
{
	return (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, NULL, fn) == NULL) ?
		0 : -EBUSY;
}
EXPORT_SYMBOL(inet6_register_icmp_sender);

int inet6_unregister_icmp_sender(ip6_icmp_send_t *fn)
{
	int ret;

	ret = (cmpxchg((ip6_icmp_send_t **)&ip6_icmp_send, fn, NULL) == fn) ?
	      0 : -EINVAL;

	synchronize_net();

	return ret;
}
EXPORT_SYMBOL(inet6_unregister_icmp_sender);

void icmpv6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info)
{
	ip6_icmp_send_t *send;

	rcu_read_lock();
	send = rcu_dereference(ip6_icmp_send);

	if (!send)
		goto out;
	send(skb, type, code, info, NULL);
out:
	rcu_read_unlock();
}
EXPORT_SYMBOL(icmpv6_send);
#endif
nput type='hidden' name='showmsg' value='1'/><select name='h' onchange='this.form.submit();'>
<option value='emaclite-cleanup'>emaclite-cleanup</option>
<option value='master' selected='selected'>master</option>
<option value='nds-private-remove'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=e69e46261063a25c3907bed16a2e9d18b115d1fd'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/include/net/lib80211.h?showmsg=1'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/include/net/lib80211.h?id=e69e46261063a25c3907bed16a2e9d18b115d1fd'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/include/net/lib80211.h?id=e69e46261063a25c3907bed16a2e9d18b115d1fd'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/include/net/lib80211.h?id=e69e46261063a25c3907bed16a2e9d18b115d1fd'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/include/net/lib80211.h'>
<input type='hidden' name='id' value='e69e46261063a25c3907bed16a2e9d18b115d1fd'/><input type='hidden' name='showmsg' value='1'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?id=e69e46261063a25c3907bed16a2e9d18b115d1fd&amp;showmsg=1'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/include?id=e69e46261063a25c3907bed16a2e9d18b115d1fd&amp;showmsg=1'>include</a>/<a href='/cgit.cgi/linux/net-next.git/log/include/net?id=e69e46261063a25c3907bed16a2e9d18b115d1fd&amp;showmsg=1'>net</a>/<a href='/cgit.cgi/linux/net-next.git/log/include/net/lib80211.h?id=e69e46261063a25c3907bed16a2e9d18b115d1fd&amp;showmsg=1'>lib80211.h</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/include/net/lib80211.h?id=e69e46261063a25c3907bed16a2e9d18b115d1fd'>Collapse</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>