summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-01-23 20:41:42 +0000
committerbluhm <bluhm@openbsd.org>2018-01-23 20:41:42 +0000
commitf1bbc13fb33be8dd9d7a2da6f97f96d959fa343f (patch)
tree3cbfee3c6304f80feb93881935f23bc042e0c1ad
parentFix a logic bug in sshd_exchange_identification which prevented clients (diff)
downloadwireguard-openbsd-f1bbc13fb33be8dd9d7a2da6f97f96d959fa343f.tar.xz
wireguard-openbsd-f1bbc13fb33be8dd9d7a2da6f97f96d959fa343f.zip
Fix printf(9) format strings so that a kernel with TCPDEBUG compiles.
Mark the string variables with TCP debugging names as constant. OK mpi@
-rw-r--r--sys/netinet/tcp_debug.c8
-rw-r--r--sys/netinet/tcp_debug.h4
-rw-r--r--sys/sys/protosw.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c
index 717699fc7ed..7e301ec8d2b 100644
--- a/sys/netinet/tcp_debug.c
+++ b/sys/netinet/tcp_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_debug.c,v 1.24 2017/05/18 11:38:07 mpi Exp $ */
+/* $OpenBSD: tcp_debug.c,v 1.25 2018/01/23 20:41:42 bluhm Exp $ */
/* $NetBSD: tcp_debug.c,v 1.10 1996/02/13 23:43:36 christos Exp $ */
/*
@@ -162,7 +162,7 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, caddr_t headers,
if (tcpconsdebug == 0)
return;
if (tp)
- printf("%x %s:", tp, tcpstates[ostate]);
+ printf("%p %s:", tp, tcpstates[ostate]);
else
printf("???????? ");
printf("%s ", tanames[act]);
@@ -205,10 +205,10 @@ tcp_trace(short act, short ostate, struct tcpcb *tp, caddr_t headers,
printf("\n");
if (tp == 0)
return;
- printf("\trcv_(nxt,wnd,up) (%x,%x,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
+ printf("\trcv_(nxt,wnd,up) (%x,%lx,%x) snd_(una,nxt,max) (%x,%x,%x)\n",
tp->rcv_nxt, tp->rcv_wnd, tp->rcv_up, tp->snd_una, tp->snd_nxt,
tp->snd_max);
- printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%x)\n",
+ printf("\tsnd_(wl1,wl2,wnd) (%x,%x,%lx)\n",
tp->snd_wl1, tp->snd_wl2, tp->snd_wnd);
#endif /* TCPDEBUG */
}
diff --git a/sys/netinet/tcp_debug.h b/sys/netinet/tcp_debug.h
index 70ce6497738..d7789e23f45 100644
--- a/sys/netinet/tcp_debug.h
+++ b/sys/netinet/tcp_debug.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_debug.h,v 1.9 2017/05/18 11:38:07 mpi Exp $ */
+/* $OpenBSD: tcp_debug.h,v 1.10 2018/01/23 20:41:42 bluhm Exp $ */
/* $NetBSD: tcp_debug.h,v 1.5 1994/06/29 06:38:38 cgd Exp $ */
/*
@@ -95,7 +95,7 @@ struct tcp_debug {
#define TA_DROP 4
#ifdef TANAMES
-char *tanames[] =
+const char *tanames[] =
{ "input", "output", "user", "respond", "drop" };
#endif /* TANAMES */
diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h
index dac57277d7a..4bd22c85573 100644
--- a/sys/sys/protosw.h
+++ b/sys/sys/protosw.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: protosw.h,v 1.29 2018/01/22 20:27:28 bluhm Exp $ */
+/* $OpenBSD: protosw.h,v 1.30 2018/01/23 20:41:42 bluhm Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
@@ -147,7 +147,7 @@ struct protosw {
#define PRU_NREQ 22
#ifdef PRUREQUESTS
-char *prurequests[] = {
+const char *prurequests[] = {
"", "DETACH", "BIND", "LISTEN",
"CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
"RCVD", "SEND", "ABORT", "CONTROL",