aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:21 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:21 +0000
commit700a395c581c43d77cc827b9fb326ece629bf4c1 (patch)
treed79b0ce3625e451f6c2a62eecaf5cf223c9e37f1
parent13ec6858d64ae47b9c24e3d30dd578114729c9fa (diff)
downloadsrc-700a395c581c43d77cc827b9fb326ece629bf4c1.tar.gz
src-700a395c581c43d77cc827b9fb326ece629bf4c1.zip
tcp_log_vain/addrs: Use a const pointer for the IPv4 header.
The pointer to the IPv6 header was already const.
-rw-r--r--sys/netinet/tcp_subr.c10
-rw-r--r--sys/netinet/tcp_var.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 189e2cf26fa6..3b02cd6d1945 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -377,7 +377,7 @@ static struct inpcb *tcp_notify(struct inpcb *, int);
static struct inpcb *tcp_mtudisc_notify(struct inpcb *, int);
static struct inpcb *tcp_mtudisc(struct inpcb *, int);
static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th,
- void *ip4hdr, const void *ip6hdr);
+ const void *ip4hdr, const void *ip6hdr);
static struct tcp_function_block tcp_def_funcblk = {
.tfb_tcp_block_name = "freebsd",
@@ -3888,7 +3888,7 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, switch_to_ifnet_tls,
* and ip6_hdr pointers have to be passed as void pointers.
*/
char *
-tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
+tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, const void *ip4hdr,
const void *ip6hdr)
{
@@ -3900,7 +3900,7 @@ tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
}
char *
-tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
+tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, const void *ip4hdr,
const void *ip6hdr)
{
@@ -3912,13 +3912,13 @@ tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
}
static char *
-tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
+tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, const void *ip4hdr,
const void *ip6hdr)
{
char *s, *sp;
size_t size;
#ifdef INET
- struct ip *ip = (struct ip *)ip4hdr;
+ const struct ip *ip = (const struct ip *)ip4hdr;
#endif
#ifdef INET6
const struct ip6_hdr *ip6 = (const struct ip6_hdr *)ip6hdr;
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index b9d37471771c..be9ff06f3a85 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -1087,9 +1087,9 @@ int tcp_ctloutput(struct socket *, struct sockopt *);
void tcp_ctlinput_viaudp(int, struct sockaddr *, void *, void *);
void tcp_drain(void);
void tcp_fini(void *);
-char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *,
+char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, const void *,
const void *);
-char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *,
+char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, const void *,
const void *);
int tcp_reass(struct tcpcb *, struct tcphdr *, tcp_seq *, int *,
struct mbuf *);