On 08/06/17(Thu) 00:47, Jan Klemkow wrote:
> Hi,
>
> 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 ;)
> 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 7 Jun 2017 22:11:31 -0000
> @@ -715,6 +715,8 @@ 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. */
> + rtm_send(rt, RTM_RESOLVE, ifp->if_rdomain);
> if (!ND6_LLINFO_PERMANENT(ln)) {
> nd6_llinfo_settimer(ln,
> ND_IFINFO(ifp)->reachable);
>