#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
 value='11e3b725cfc282efe9d4a354153e99d86a16af08'/><select name='h' onchange='this.form.submit();'>
<option value='emaclite-cleanup'>emaclite-cleanup</option>
<option value='master'>master</option>
<option value='nds-private-remove' selected='selected'>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/?h=nds-private-remove'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>refs</a><a href='/cgit.cgi/linux/net-next.git/log/net/batman-adv/multicast.h?h=nds-private-remove'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/net/batman-adv/multicast.h?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/net/batman-adv/multicast.h?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>commit</a><a class='active' href='/cgit.cgi/linux/net-next.git/diff/net/batman-adv/multicast.h?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/net/batman-adv/multicast.h'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='11e3b725cfc282efe9d4a354153e99d86a16af08'/><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/diff/?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>root</a>/<a href='/cgit.cgi/linux/net-next.git/diff/net?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>net</a>/<a href='/cgit.cgi/linux/net-next.git/diff/net/batman-adv?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>batman-adv</a>/<a href='/cgit.cgi/linux/net-next.git/diff/net/batman-adv/multicast.h?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>multicast.h</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='11e3b725cfc282efe9d4a354153e99d86a16af08'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&amp;id=11e3b725cfc282efe9d4a354153e99d86a16af08'>Diffstat</a> (limited to 'net/batman-adv/multicast.h')</div><table summary='diffstat' class='diffstat'>