Hi Martin,
On Thu, Jun 08, 2017 at 09:44:37AM +0200, Martin Pieuchot wrote:
> On 08/06/17(Thu) 00:47, Jan Klemkow wrote:
> > This diff adds a missing routing message to the neighbor discovery code.
> > The message informs the userland about new reachable IPv6 nodes on the
> > network. The IPv6 network stack acts more like the IPv4 port by this
> > diff. Now, the behavior is like arpcache() in netinet/if_ether.c on
> > line 653.
>
> The call should be under KERNEL_LOCK()/KERNEL_UNLOCK(). Writing to
> routing sockets isn't protected by the NET_LOCK().
>
> Yes this doesn't matter right now, but since we're working on removing
> the KERNEL_LOCK() from the protocol layer, let's have this ready ;)
Here is a fixed version of this diff.
Thanks,
Jan
Index: nd6_nbr.c
===================================================================
RCS file: /cvs/src/sys/netinet6/nd6_nbr.c,v
retrieving revision 1.116
diff -u -p -r1.116 nd6_nbr.c
--- nd6_nbr.c 16 May 2017 12:24:04 -0000 1.116
+++ nd6_nbr.c 8 Jun 2017 08:44:28 -0000
@@ -715,6 +715,10 @@ nd6_na_input(struct mbuf *m, int off, in
if (is_solicited) {
ln->ln_state = ND6_LLINFO_REACHABLE;
ln->ln_byhint = 0;
+ /* Notify userland that a new ND entry is reachable. */
+ KERNEL_LOCK();
+ rtm_send(rt, RTM_RESOLVE, ifp->if_rdomain);
+ KERNEL_UNLOCK();
if (!ND6_LLINFO_PERMANENT(ln)) {
nd6_llinfo_settimer(ln,
ND_IFINFO(ifp)->reachable);