git: 177f04d57fbd - main - routing: constantify @rc in rib_decompose_notification().
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 29 Aug 2022 18:12:31 UTC
The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=177f04d57fbdb1c18ed845e19cc9b902c8b65312 commit 177f04d57fbdb1c18ed845e19cc9b902c8b65312 Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2022-08-29 18:10:21 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2022-08-29 18:12:24 +0000 routing: constantify @rc in rib_decompose_notification(). Clarify the @rc immutability by explicitly marking @rc const. MFC after: 2 weeks --- sys/net/route/route_ctl.h | 4 ++-- sys/net/route/route_helpers.c | 4 ++-- sys/net/rtsock.c | 4 ++-- sys/netinet6/nd6.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/net/route/route_ctl.h b/sys/net/route/route_ctl.h index e73a6dcf8a93..0b331e5f7d2c 100644 --- a/sys/net/route/route_ctl.h +++ b/sys/net/route/route_ctl.h @@ -82,8 +82,8 @@ int rib_handle_ifaddr_info(uint32_t fibnum, int cmd, struct rt_addrinfo *info); int rib_add_default_route(uint32_t fibnum, int family, struct ifnet *ifp, struct sockaddr *gw, struct rib_cmd_info *rc); -typedef void route_notification_t(struct rib_cmd_info *rc, void *); -void rib_decompose_notification(struct rib_cmd_info *rc, +typedef void route_notification_t(const struct rib_cmd_info *rc, void *); +void rib_decompose_notification(const struct rib_cmd_info *rc, route_notification_t *cb, void *cbdata); int rib_add_redirect(u_int fibnum, struct sockaddr *dst, diff --git a/sys/net/route/route_helpers.c b/sys/net/route/route_helpers.c index fe503db368ce..465e0de81882 100644 --- a/sys/net/route/route_helpers.c +++ b/sys/net/route/route_helpers.c @@ -292,7 +292,7 @@ notify_del(struct rib_cmd_info *rc, const struct weightened_nhop *wn_src, } static void -decompose_change_notification(struct rib_cmd_info *rc, route_notification_t *cb, +decompose_change_notification(const struct rib_cmd_info *rc, route_notification_t *cb, void *cbdata) { uint32_t num_old, num_new; @@ -379,7 +379,7 @@ decompose_change_notification(struct rib_cmd_info *rc, route_notification_t *cb, * Assumes at least one of the nexthops in @rc is multipath. */ void -rib_decompose_notification(struct rib_cmd_info *rc, route_notification_t *cb, +rib_decompose_notification(const struct rib_cmd_info *rc, route_notification_t *cb, void *cbdata) { const struct weightened_nhop *wn; diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 1ddb72d926b9..91ad8c79a5eb 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -935,7 +935,7 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, #ifdef ROUTE_MPATH static void -save_del_notification(struct rib_cmd_info *rc, void *_cbdata) +save_del_notification(const struct rib_cmd_info *rc, void *_cbdata) { struct rib_cmd_info *rc_new = (struct rib_cmd_info *)_cbdata; @@ -944,7 +944,7 @@ save_del_notification(struct rib_cmd_info *rc, void *_cbdata) } static void -save_add_notification(struct rib_cmd_info *rc, void *_cbdata) +save_add_notification(const struct rib_cmd_info *rc, void *_cbdata) { struct rib_cmd_info *rc_new = (struct rib_cmd_info *)_cbdata; diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 0382b1525d4a..84af00eabaac 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1591,7 +1591,7 @@ nd6_free_redirect(const struct llentry *ln) * Updates status of the default router route. */ static void -check_release_defrouter(struct rib_cmd_info *rc, void *_cbdata) +check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata) { struct nd_defrouter *dr; struct nhop_object *nh;