The branch stable/13 has been updated by melifaro:

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

commit 972fcfb34b0d84dc1d869c351da8e19c702a3c35
Author:     Alexander V. Chernikov <melif...@freebsd.org>
AuthorDate: 2021-04-28 20:21:58 +0000
Commit:     Alexander V. Chernikov <melif...@freebsd.org>
CommitDate: 2021-05-04 21:31:36 +0000

    [fib algo] Update fib_gen counter under FIB_MOD_LOCK.
    
    MFC after:      3 days
    
    (cherry picked from commit 41ce0e34ea42a4f7113d1ba15d25b9b64d5921b8)
---
 sys/net/route/fib_algo.c | 6 +++---
 1 file 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);
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to