We link `ifp' to `if_list' before we perform if_attachsetup(). It is not
authormvs <mvs@openbsd.org>
Thu, 11 Feb 2021 20:28:01 +0000 (20:28 +0000)
committermvs <mvs@openbsd.org>
Thu, 11 Feb 2021 20:28:01 +0000 (20:28 +0000)
commit8afa9f3ec1885f5426744f9dd55c436b9aa5ad6a
treebee3a21ee1710235b43876cf97981f95324a7a8a
parenta738a6b060f8fd59ee2a60e7662bbecf5675887d
We link `ifp' to `if_list' before we perform if_attachsetup(). It is not
fully initialized because we initialize `if_groups' after linking. It's
not triggered because if_attach() and if_unit(9) are serialized by
kernel lock and `ifp' is often filled by nulls. Move `if_groups'
initialization to if_attach_common() to prevent this.

ok bluhm@ claudio@ deraadt@
sys/net/if.c