Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet6 nd6: notify userland of neighbour lla updates o...
details: https://anonhg.NetBSD.org/src/rev/31385cd1e141
branches: trunk
changeset: 453683:31385cd1e141
user: roy <roy%NetBSD.org@localhost>
date: Thu Aug 22 21:22:50 2019 +0000
description:
nd6: notify userland of neighbour lla updates once more
XXX pullup -8 -9
diffstat:
sys/netinet6/nd6.c | 21 ++++++++++++++-------
sys/netinet6/nd6_nbr.c | 16 +++++++++-------
2 files changed, 23 insertions(+), 14 deletions(-)
diffs (93 lines):
diff -r 1f45eea9f333 -r 31385cd1e141 sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c Thu Aug 22 21:14:45 2019 +0000
+++ b/sys/netinet6/nd6.c Thu Aug 22 21:22:50 2019 +0000
@@ -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 @@
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 @@
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 @@
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;
diff -r 1f45eea9f333 -r 31385cd1e141 sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c Thu Aug 22 21:14:45 2019 +0000
+++ b/sys/netinet6/nd6_nbr.c Thu Aug 22 21:22:50 2019 +0000
@@ -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 @@
*/
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)
Home |
Main Index |
Thread Index |
Old Index