summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6.h
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-01-27 21:13:47 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-01-27 21:13:47 +0000
commit8a0fe2bd530f51675a95b73d96288074c22de5b3 (patch)
treecd0cf68108a807e676eb995b7f4d17bd6b671931 /sys/netinet6/in6.h
parent64a301ca019038e15fff505d24bf21a1fc5a85cd (diff)
Declare address parameter in TCP SYN cache const.
tcp6_ctlinput() casted a constant sockaddr_sin6 to non-const sockaddr. sa6_src may be &sa6_any which lives in read-only data section. Better pass down the const addresses to syn_cache_lookup(). They are needed for hash lookup and are not modified. OK mvs@
Diffstat (limited to 'sys/netinet6/in6.h')
-rw-r--r--sys/netinet6/in6.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 936ef6c9465..98384bfd352 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6.h,v 1.111 2023/11/28 13:23:20 bluhm Exp $ */
+/* $OpenBSD: in6.h,v 1.112 2024/01/27 21:13:46 bluhm Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@@ -459,6 +459,12 @@ sin6tosa(struct sockaddr_in6 *sin6)
return ((struct sockaddr *)(sin6));
}
+static inline const struct sockaddr *
+sin6tosa_const(const struct sockaddr_in6 *sin6)
+{
+ return ((const struct sockaddr *)(sin6));
+}
+
static inline struct in6_ifaddr *
ifatoia6(struct ifaddr *ifa)
{