git: db98b4205093 - main - netinet6: call lle_event eventhandler after updating state

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Mon, 05 Sep 2022 13:01:34 UTC
The branch main has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=db98b4205093a6ee201ce0b8d83c77d5b730d7cb

commit db98b4205093a6ee201ce0b8d83c77d5b730d7cb
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2022-09-05 12:57:20 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2022-09-05 13:01:27 +0000

    netinet6: call lle_event eventhandler after updating state
    
    Fix nd6_na_input() eventhandler call: run eventhandler after lle
     state transition.
    
    Old behaviour (as seen by event handler):
     * fe80::5054:ff:fe8c:63e9 dev vtnet0 lladdr 52:54:00:8c:63:e9 INCOMPLETE
    New behaviour:
    * fe80::5054:ff:fe8c:63e9 dev vtnet0 lladdr 52:54:00:8c:63:e9 REACHABLE
    
    MFC after: 2 weeks
---
 sys/netinet6/nd6_nbr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 7877a7bc91b1..f96bf8e58dc3 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -786,11 +786,11 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
 			goto freeit;
 
 		flush_holdchain = true;
-		EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED);
 		if (is_solicited)
 			nd6_llinfo_setstate(ln, ND6_LLINFO_REACHABLE);
 		else
 			nd6_llinfo_setstate(ln, ND6_LLINFO_STALE);
+		EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED);
 		if ((ln->ln_router = is_router) != 0) {
 			/*
 			 * This means a router's state has changed from