aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2022-09-08 10:21:25 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2022-09-08 10:21:25 +0000
commite7624170772d28c89e841b817634666bbc658ffd (patch)
tree3974d6720a505d1a8e11a1f9c65d6730c59d7201
parent000250be0d2dc7a241f1c9b9c27d941af781ca46 (diff)
downloadsrc-e7624170772d28c89e841b817634666bbc658ffd.tar.gz
src-e7624170772d28c89e841b817634666bbc658ffd.zip
routing: constantify nh/nhg argument in <nhop|nhgrp>_get_origin().
MFC after: 1 month
-rw-r--r--sys/net/route/nhgrp_ctl.c4
-rw-r--r--sys/net/route/nhop.h4
-rw-r--r--sys/net/route/nhop_ctl.c2
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);
}