git: e0f305d9a99d - stable/9 - if_firewire: fixing panic upon packet reception for VNET build

From: Tai-hwa Liang <avatar_at_FreeBSD.org>
Date: Tue, 13 Sep 2022 11:37:58 UTC
The branch stable/9 has been updated by avatar:

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

commit e0f305d9a99d83a9d4dba7518459a978c67a0059
Author:     Tai-hwa Liang <avatar@FreeBSD.org>
AuthorDate: 2021-04-10 15:32:27 +0000
Commit:     Tai-hwa Liang <avatar@FreeBSD.org>
CommitDate: 2021-05-25 23:53:59 +0000

    if_firewire: fixing panic upon packet reception for VNET build
    
    netisr_dispatch_src() needs valid VNET pointer or firewire_input() will panic
    when receiving a packet.
    
    Reviewed by:    glebius
    MFC after:      2 weeks
    
    (cherry picked from commit d9b61e7153c64b141436b4d9619b166c6d35a0a6)
---
 sys/net/if_fwsubr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c
index 5414d792de04..06b940cac578 100644
--- a/sys/net/if_fwsubr.c
+++ b/sys/net/if_fwsubr.c
@@ -628,7 +628,9 @@ firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src)
 	}
 
 	M_SETFIB(m, ifp->if_fib);
+	CURVNET_SET_QUIET(ifp->if_vnet);
 	netisr_dispatch(isr, m);
+	CURVNET_RESTORE();
 }
 
 int