-/* $OpenBSD: tcp_input.c,v 1.398 2024/01/11 13:49:49 bluhm Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.399 2024/01/27 21:13:46 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
struct socket *syn_cache_get(struct sockaddr *, struct sockaddr *,
struct tcphdr *, unsigned int, unsigned int, struct socket *,
struct mbuf *, uint64_t);
-struct syn_cache *syn_cache_lookup(struct sockaddr *, struct sockaddr *,
- struct syn_cache_head **, u_int);
+struct syn_cache *syn_cache_lookup(const struct sockaddr *,
+ const struct sockaddr *, struct syn_cache_head **, u_int);
/*
* Insert segment ti into reassembly queue of tcp with
#ifndef INET6
#define SYN_HASHALL(hash, src, dst, rand) \
do { \
- hash = SYN_HASH(&satosin(src)->sin_addr, \
- satosin(src)->sin_port, \
- satosin(dst)->sin_port, (rand)); \
+ hash = SYN_HASH(&satosin_const(src)->sin_addr, \
+ satosin_const(src)->sin_port, \
+ satosin_const(dst)->sin_port, (rand)); \
} while (/*CONSTCOND*/ 0)
#else
#define SYN_HASH6(sa, sp, dp, rand) \
do { \
switch ((src)->sa_family) { \
case AF_INET: \
- hash = SYN_HASH(&satosin(src)->sin_addr, \
- satosin(src)->sin_port, \
- satosin(dst)->sin_port, (rand)); \
+ hash = SYN_HASH(&satosin_const(src)->sin_addr, \
+ satosin_const(src)->sin_port, \
+ satosin_const(dst)->sin_port, (rand)); \
break; \
case AF_INET6: \
- hash = SYN_HASH6(&satosin6(src)->sin6_addr, \
- satosin6(src)->sin6_port, \
- satosin6(dst)->sin6_port, (rand)); \
+ hash = SYN_HASH6(&satosin6_const(src)->sin6_addr, \
+ satosin6_const(src)->sin6_port, \
+ satosin6_const(dst)->sin6_port, (rand)); \
break; \
default: \
hash = 0; \
* Find an entry in the syn cache.
*/
struct syn_cache *
-syn_cache_lookup(struct sockaddr *src, struct sockaddr *dst,
+syn_cache_lookup(const struct sockaddr *src, const struct sockaddr *dst,
struct syn_cache_head **headp, u_int rtableid)
{
struct syn_cache_set *sets[2];
}
void
-syn_cache_unreach(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
- u_int rtableid)
+syn_cache_unreach(const struct sockaddr *src, const struct sockaddr *dst,
+ struct tcphdr *th, u_int rtableid)
{
struct syn_cache *sc;
struct syn_cache_head *scp;
-/* $OpenBSD: tcp_subr.c,v 1.195 2024/01/11 13:49:49 bluhm Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.196 2024/01/27 21:13:46 bluhm Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
} else if (inet6ctlerrmap[cmd] == EHOSTUNREACH ||
inet6ctlerrmap[cmd] == ENETUNREACH ||
inet6ctlerrmap[cmd] == EHOSTDOWN)
- syn_cache_unreach((struct sockaddr *)sa6_src,
- sa, &th, rdomain);
+ syn_cache_unreach(sin6tosa_const(sa6_src), sa, &th,
+ rdomain);
in_pcbunref(inp);
} else {
in6_pcbnotify(&tcbtable, sa6, 0,
-/* $OpenBSD: tcp_var.h,v 1.174 2024/01/11 13:49:49 bluhm Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.175 2024/01/27 21:13:46 bluhm Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
#endif /* TCP_SIGNATURE */
void tcp_set_iss_tsm(struct tcpcb *);
-void syn_cache_unreach(struct sockaddr *, struct sockaddr *,
+void syn_cache_unreach(const struct sockaddr *, const struct sockaddr *,
struct tcphdr *, u_int);
void syn_cache_init(void);
void syn_cache_cleanup(struct tcpcb *);