mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
ifnet: Assert that we are assigning network stack correctly
It makes no sense to assign NULL vnet to an interface when the kernel option VIMAGE is enabled. Add an assertion to catch that. This will also help diagnosing problem report [1] and [2]. 1. https://bugs.freebsd.org/275381 2. https://bugs.freebsd.org/282168 Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46982 (cherry picked from commit d1d839d0b593541174ca48c675c9eff4ddb4715e)
This commit is contained in:
parent
01f4a503eb
commit
2f3c87296c
1 changed files with 1 additions and 0 deletions
|
|
@ -834,6 +834,7 @@ if_attach_internal(struct ifnet *ifp, bool vmove)
|
|||
MPASS(ifindex_table[ifp->if_index].ife_ifnet == ifp);
|
||||
|
||||
#ifdef VIMAGE
|
||||
CURVNET_ASSERT_SET();
|
||||
ifp->if_vnet = curvnet;
|
||||
if (ifp->if_home_vnet == NULL)
|
||||
ifp->if_home_vnet = curvnet;
|
||||
|
|
|
|||
Loading…
Reference in a new issue