git: 9e67981e7855 - stable/14 - in6: Constify some sockaddr conversion functions

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 22 Nov 2024 21:24:12 UTC
The branch stable/14 has been updated by markj:

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

commit 9e67981e7855bcaf50717491287b0ba8ea23495e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-14 19:20:21 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-22 21:23:47 +0000

    in6: Constify some sockaddr conversion functions
    
    No functional change intended.
    
    MFC after:      1 week
    Sponsored by:   Klara, Inc.
    Sponsored by:   Stormshield
    
    (cherry picked from commit 3bb15ffc4ab4bfcd4c1bd700a64b3b5ed95389c3)
---
 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 e9f16dcf5c54..54b9d598b961 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2655,7 +2655,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));
@@ -2667,7 +2667,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 ce3bbea6b8e6..0a4377638de1 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -679,9 +679,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);
 void	in6_sin_2_v4mapsin6_in_sock(struct sockaddr **nam);
 extern void addrsel_policy_init(void);