ifnet: initial if_grow() shall always succeed
So let's just call malloc() directly. This also avoids hidden doubling of default V_if_indexlim. Reviewed by: melifaro, bz, kp Differential revision: https://reviews.freebsd.org/D33261
This commit is contained in:
parent
450394af27
commit
6ff4cac2ee
@ -441,15 +441,11 @@ ifaddr_byindex(u_short idx)
|
||||
static void
|
||||
vnet_if_init(const void *unused __unused)
|
||||
{
|
||||
void *old;
|
||||
|
||||
CK_STAILQ_INIT(&V_ifnet);
|
||||
CK_STAILQ_INIT(&V_ifg_head);
|
||||
IFNET_WLOCK();
|
||||
old = if_grow(); /* create initial table */
|
||||
IFNET_WUNLOCK();
|
||||
epoch_wait_preempt(net_epoch_preempt);
|
||||
free(old, M_IFNET);
|
||||
V_ifindex_table = malloc(V_if_indexlim * sizeof(*V_ifindex_table),
|
||||
M_IFNET, M_WAITOK | M_ZERO);
|
||||
vnet_if_clone_init();
|
||||
}
|
||||
VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init,
|
||||
|
Loading…
Reference in New Issue
Block a user