git: ad1954ec9405 - stable/13 - routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin().

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

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

commit ad1954ec94052117de465c2b1874759dc0499ad2
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2022-09-08 10:21:25 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-01-13 21:24:12 +0000

    routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin().
    
    MFC after:      1 month
    
    (cherry picked from commit e7624170772d28c89e841b817634666bbc658ffd)
---
 sys/net/route/nhgrp_ctl.c | 4 ++--
 sys/net/route/nhop.h      | 4 ++--
 sys/net/route/nhop_ctl.c  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/net/route/nhgrp_ctl.c b/sys/net/route/nhgrp_ctl.c
index 06f46746be4b..842f9d5376bc 100644
--- a/sys/net/route/nhgrp_ctl.c
+++ b/sys/net/route/nhgrp_ctl.c
@@ -853,9 +853,9 @@ nhgrp_get_idx(const struct nhgrp_object *nhg)
 }
 
 uint8_t
-nhgrp_get_origin(struct nhgrp_object *nhg)
+nhgrp_get_origin(const struct nhgrp_object *nhg)
 {
-	return (NHGRP_PRIV(nhg)->nhg_origin);
+	return (NHGRP_PRIV_CONST(nhg)->nhg_origin);
 }
 
 void
diff --git a/sys/net/route/nhop.h b/sys/net/route/nhop.h
index 669284e0ac62..f0feccd6c0f2 100644
--- a/sys/net/route/nhop.h
+++ b/sys/net/route/nhop.h
@@ -205,7 +205,7 @@ void nhop_set_transmit_ifp(struct nhop_object *nh, struct ifnet *ifp);
 #define	NH_ORIGIN_BOOT		3 /* kernel-originated routes at boot */
 #define	NH_ORIGIN_STATIC	4 /* route(8) routes */
 void nhop_set_origin(struct nhop_object *nh, uint8_t origin);
-uint8_t nhop_get_origin(struct nhop_object *nh);
+uint8_t nhop_get_origin(const struct nhop_object *nh);
 
 uint32_t nhop_get_idx(const struct nhop_object *nh);
 uint32_t nhop_get_uidx(const struct nhop_object *nh);
@@ -225,7 +225,7 @@ struct rib_head *nhop_get_rh(const struct nhop_object *nh);
 
 struct nhgrp_object;
 uint32_t nhgrp_get_uidx(const struct nhgrp_object *nhg);
-uint8_t nhgrp_get_origin(struct nhgrp_object *nhg);
+uint8_t nhgrp_get_origin(const struct nhgrp_object *nhg);
 void nhgrp_set_origin(struct nhgrp_object *nhg, uint8_t origin);
 #endif /* _KERNEL */
 
diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c
index 033a99acab1b..d5d921dd66c7 100644
--- a/sys/net/route/nhop_ctl.c
+++ b/sys/net/route/nhop_ctl.c
@@ -1013,7 +1013,7 @@ nhop_get_rh(const struct nhop_object *nh)
 }
 
 uint8_t
-nhop_get_origin(struct nhop_object *nh)
+nhop_get_origin(const struct nhop_object *nh)
 {
 	return (nh->nh_priv->nh_origin);
 }