nd6: notify userland of neighbour lla updates once more

XXX pullup -8 -9
This commit is contained in:
roy 2019-08-22 21:22:50 +00:00
parent 508a301f81
commit ece8d0874e
2 changed files with 23 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nd6.c,v 1.258 2019/08/22 21:14:46 roy Exp $ */
/* $NetBSD: nd6.c,v 1.259 2019/08/22 21:22:50 roy Exp $ */
/* $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.258 2019/08/22 21:14:46 roy Exp $");
__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.259 2019/08/22 21:22:50 roy Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@ -1192,6 +1192,7 @@ nd6_free(struct llentry *ln, int gc)
struct nd_defrouter *dr;
struct ifnet *ifp;
struct in6_addr *in6;
struct sockaddr_in6 sin6;
KASSERT(ln != NULL);
LLE_WLOCK_ASSERT(ln);
@ -1293,6 +1294,10 @@ nd6_free(struct llentry *ln, int gc)
LLE_WLOCK(ln);
}
sockaddr_in6_init(&sin6, in6, 0, 0, 0);
rt_clonedmsg(RTM_DELETE, sin6tosa(&sin6),
(const uint8_t *)&ln->ll_addr, ifp);
/*
* Save to unlock. We still hold an extra reference and will not
* free(9) in llentry_free() if someone else holds one as well.
@ -2225,11 +2230,13 @@ nd6_cache_lladdr(
break;
}
#if 0
/* XXX should we send rtmsg as it used to be? */
if (do_update)
rt_newmsg(RTM_CHANGE, rt); /* tell user process */
#endif
if (do_update) {
struct sockaddr_in6 sin6;
sockaddr_in6_init(&sin6, from, 0, 0, 0);
rt_clonedmsg(is_newentry ? RTM_ADD : RTM_CHANGE,
sin6tosa(&sin6), lladdr, ifp);
}
if (ln != NULL) {
router = ln->ln_router;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nd6_nbr.c,v 1.166 2019/04/29 16:12:30 roy Exp $ */
/* $NetBSD: nd6_nbr.c,v 1.167 2019/08/22 21:22:50 roy Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.166 2019/04/29 16:12:30 roy Exp $");
__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.167 2019/08/22 21:22:50 roy Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -883,11 +883,13 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
*/
ln->ln_asked = 0;
nd6_llinfo_release_pkts(ln, ifp);
/* FIXME */
#if 0
if (rt_announce) /* tell user process about any new lladdr */
rt_newmsg(RTM_CHANGE, rt);
#endif
if (rt_announce) {
struct sockaddr_in6 sin6;
sockaddr_in6_init(&sin6, &taddr6, 0, 0, 0);
rt_clonedmsg(RTM_CHANGE, sin6tosa(&sin6), lladdr, ifp);
}
freeit:
if (ln != NULL)