git: f51d7f8fb5b0 - stable/13 - routing: copy nexthop fib when changing existing nexthop

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Fri, 13 Jan 2023 21:24:37 UTC
The branch stable/13 has been updated by melifaro:

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

commit f51d7f8fb5b07060f6a21484bf9359bb457e08be
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-01-13 12:28:22 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-01-13 21:18:24 +0000

    routing: copy nexthop fib when changing existing nexthop
    
    MFC after:      1 day
    
    (cherry picked from commit 1b8b69508bc55a797ba344f95f05978408629e25)
---
 sys/net/route/nhop_ctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c
index 5dfc275cd1e7..b0f31f400bd3 100644
--- a/sys/net/route/nhop_ctl.c
+++ b/sys/net/route/nhop_ctl.c
@@ -474,6 +474,7 @@ nhop_create_from_nhop(struct rib_head *rnh, const struct nhop_object *nh_orig,
 	nh_priv->nh_neigh_family = nh_orig->nh_priv->nh_neigh_family;
 	nh_priv->rt_flags = nh_orig->nh_priv->rt_flags;
 	nh_priv->nh_type = nh_orig->nh_priv->nh_type;
+	nh_priv->nh_fibnum = nh_orig->nh_priv->nh_fibnum;
 
 	nh->nh_ifp = nh_orig->nh_ifp;
 	nh->nh_ifa = nh_orig->nh_ifa;