aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2021-04-28 20:21:58 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2021-04-28 20:23:03 +0000
commit41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8 (patch)
tree1c89b87e2cf25c7daf3daddc68f232e73189a395
parent074abaccfaadef0da6e2695225ce537cb53bb8de (diff)
downloadsrc-41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8.tar.gz
src-41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8.zip
[fib algo] Update fib_gen counter under FIB_MOD_LOCK.
MFC after: 3 days
-rw-r--r--sys/net/route/fib_algo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c
index 837ea7c2b43b..3a09408c92b1 100644
--- a/sys/net/route/fib_algo.c
+++ b/sys/net/route/fib_algo.c
@@ -1169,19 +1169,19 @@ try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh,
estimate_nhop_scale(old_fd, fd);
fd->fd_rh = rh;
- fd->fd_gen = ++fib_gen;
fd->fd_family = rh->rib_family;
fd->fd_fibnum = rh->rib_fibnum;
callout_init_rm(&fd->fd_callout, &rh->rib_lock, 0);
fd->fd_vnet = curvnet;
fd->fd_flm = flm;
- FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd);
-
FIB_MOD_LOCK();
flm->flm_refcount++;
+ fd->fd_gen = ++fib_gen;
FIB_MOD_UNLOCK();
+ FD_PRINTF(LOG_DEBUG, fd, "allocated fd %p", fd);
+
/* Allocate nhidx -> nhop_ptr table */
size = fd->number_nhops * sizeof(void *);
fd->nh_idx = malloc(size, M_RTABLE, M_NOWAIT | M_ZERO);