On Fri, 7 Jul 2023 10:43:21 +0200
Claudio Jeker <clau...@openbsd.org> wrote:
>> @@ -411,7 +412,7 @@ tcp_stats_display(unsigned long long tot
>>                      P(tcpi, rcv_up, "%u")
>>                      P(tcpi, rcv_wscale, "%hhu")
>>                      P(tcpi, rfbuf_cnt, "%u")
>> -                    P(tcpi, rfbuf_ts, "%u")
>> +                    P(tcpi, rfbuf_ts, "%" PRIu64)
> 
> I don't think we need these ugly PRIu64 here. Just use %llu since in
> OpenBSD uint64_t is always a unsigned long long.

Thanks, that was what I didn't see clearly.

ok?

Index: sys/netinet/tcp.h
===================================================================
RCS file: /cvs/src/sys/netinet/tcp.h,v
retrieving revision 1.24
diff -u -p -r1.24 tcp.h
--- sys/netinet/tcp.h   19 May 2023 01:04:39 -0000      1.24
+++ sys/netinet/tcp.h   7 Jul 2023 08:51:40 -0000
@@ -194,9 +194,9 @@ struct tcp_info {
        uint32_t        tcpi_snd_wl2;
        uint32_t        tcpi_snd_max;
        uint32_t        tcpi_ts_recent;
-       uint32_t        tcpi_ts_recent_age;
+       uint64_t        tcpi_ts_recent_age;
        uint32_t        tcpi_rfbuf_cnt;
-       uint32_t        tcpi_rfbuf_ts;
+       uint64_t        tcpi_rfbuf_ts;
        uint32_t        tcpi_so_rcv_sb_cc;
        uint32_t        tcpi_so_rcv_sb_hiwat;
        uint32_t        tcpi_so_rcv_sb_lowat;
Index: usr.bin/tcpbench/tcpbench.c
===================================================================
RCS file: /cvs/src/usr.bin/tcpbench/tcpbench.c,v
retrieving revision 1.69
diff -u -p -r1.69 tcpbench.c
--- usr.bin/tcpbench/tcpbench.c 22 May 2023 12:53:04 -0000      1.69
+++ usr.bin/tcpbench/tcpbench.c 7 Jul 2023 08:51:41 -0000
@@ -411,7 +411,7 @@ tcp_stats_display(unsigned long long tot
                        P(tcpi, rcv_up, "%u")
                        P(tcpi, rcv_wscale, "%hhu")
                        P(tcpi, rfbuf_cnt, "%u")
-                       P(tcpi, rfbuf_ts, "%u")
+                       P(tcpi, rfbuf_ts, "%llu")
                        P(tcpi, rtt, "%u")
                        P(tcpi, rttmin, "%u")
                        P(tcpi, rttvar, "%u")
@@ -436,7 +436,7 @@ tcp_stats_display(unsigned long long tot
                        P(tcpi, so_snd_sb_lowat, "%u")
                        P(tcpi, so_snd_sb_wat, "%u")
                        P(tcpi, ts_recent, "%u")
-                       P(tcpi, ts_recent_age, "%u")
+                       P(tcpi, ts_recent_age, "%llu")
 #undef S
 #undef P
                }

Reply via email to