git: 3bb15ffc4ab4 - main - in6: Constify some sockaddr conversion functions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 14 Nov 2024 20:01:54 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3bb15ffc4ab4bfcd4c1bd700a64b3b5ed95389c3 commit 3bb15ffc4ab4bfcd4c1bd700a64b3b5ed95389c3 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-11-14 19:20:21 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-11-14 19:59:04 +0000 in6: Constify some sockaddr conversion functions No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/netinet6/in6.c | 4 ++-- sys/netinet6/in6.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index dba1232fd58d..ffbe64f4de80 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2653,7 +2653,7 @@ in6_domifdetach(struct ifnet *ifp, void *aux) * v4 mapped addr or v4 compat addr */ void -in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6) +in6_sin6_2_sin(struct sockaddr_in *sin, const struct sockaddr_in6 *sin6) { bzero(sin, sizeof(*sin)); @@ -2665,7 +2665,7 @@ in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6) /* Convert sockaddr_in to sockaddr_in6 in v4 mapped addr format. */ void -in6_sin_2_v4mapsin6(struct sockaddr_in *sin, struct sockaddr_in6 *sin6) +in6_sin_2_v4mapsin6(const struct sockaddr_in *sin, struct sockaddr_in6 *sin6) { bzero(sin6, sizeof(*sin6)); sin6->sin6_len = sizeof(struct sockaddr_in6); diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 082e5f8990c9..effd33787e7e 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -677,9 +677,9 @@ extern void in6_if_up(struct ifnet *); struct sockaddr; void in6_sin6_2_sin(struct sockaddr_in *sin, - struct sockaddr_in6 *sin6); -void in6_sin_2_v4mapsin6(struct sockaddr_in *sin, - struct sockaddr_in6 *sin6); + const struct sockaddr_in6 *sin6); +void in6_sin_2_v4mapsin6(const struct sockaddr_in *sin, + struct sockaddr_in6 *sin6); void in6_sin6_2_sin_in_sock(struct sockaddr *nam); extern void addrsel_policy_init(void);