Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/usr.bin/netstat Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/9c134ae059ee
branches:  netbsd-9
changeset: 462387:9c134ae059ee
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Aug 19 15:56:49 2019 +0000

description:
Pull up following revision(s) (requested by kamil in ticket #94):

        usr.bin/netstat/netstat_rumpops.c: revision 1.2
        usr.bin/netstat/netstat_hostops.c: revision 1.2
        usr.bin/netstat/inet6.c: revision 1.73
        usr.bin/netstat/bpf.c: revision 1.14
        usr.bin/netstat/Makefile: revision 1.46
        usr.bin/netstat/prog_ops.h: revision 1.3
        usr.bin/netstat/pfsync.c: revision 1.2
        usr.bin/netstat/pfkey.c: revision 1.2
        usr.bin/netstat/fast_ipsec.c: revision 1.23
        usr.bin/netstat/atalk.c: revision 1.17
        usr.bin/netstat/inet.c: revision 1.110

netstat: Add indirection of symbols to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname, sysctlgetmibinfo and sysctlnametomib.

diffstat:

 usr.bin/netstat/Makefile          |   6 +++++-
 usr.bin/netstat/atalk.c           |   7 ++++---
 usr.bin/netstat/bpf.c             |   6 +++---
 usr.bin/netstat/fast_ipsec.c      |  15 ++++++++-------
 usr.bin/netstat/inet.c            |  20 ++++++++++----------
 usr.bin/netstat/inet6.c           |  16 ++++++++--------
 usr.bin/netstat/netstat_hostops.c |  10 ++++++++--
 usr.bin/netstat/netstat_rumpops.c |  11 +++++++++--
 usr.bin/netstat/pfkey.c           |   7 ++++---
 usr.bin/netstat/pfsync.c          |   8 +++-----
 usr.bin/netstat/prog_ops.h        |  20 +++++++++++++++++++-
 11 files changed, 81 insertions(+), 45 deletions(-)

diffs (truncated from 483 to 300 lines):

diff -r ab049f633e04 -r 9c134ae059ee usr.bin/netstat/Makefile
--- a/usr.bin/netstat/Makefile  Mon Aug 19 15:53:40 2019 +0000
+++ b/usr.bin/netstat/Makefile  Mon Aug 19 15:56:49 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.45 2017/10/10 19:31:10 christos Exp $
+#      $NetBSD: Makefile,v 1.45.6.1 2019/08/19 15:56:49 martin Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/12/93
 
 .include <bsd.own.mk>
@@ -25,6 +25,10 @@
 LDADD.rump+=   -lrumpres
 DPADD.add+=    ${LIBRUMPRES}
 CPPFLAGS+=      -DRUMP_ACTION
+
+SANITIZER_RENAME_CLASSES+=     rump
+SANITIZER_RENAME_FILES.rump+=  ${PROG}_rumpops.c ${RUMPSRCS}
+SANITIZER_RENAME_SYMBOL.rump+= sysctlbyname sysctlgetmibinfo sysctlnametomib
 .endif
 
 
diff -r ab049f633e04 -r 9c134ae059ee usr.bin/netstat/atalk.c
--- a/usr.bin/netstat/atalk.c   Mon Aug 19 15:53:40 2019 +0000
+++ b/usr.bin/netstat/atalk.c   Mon Aug 19 15:56:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atalk.c,v 1.16 2015/06/06 13:08:31 joerg Exp $ */
+/*     $NetBSD: atalk.c,v 1.16.18.1 2019/08/19 15:56:49 martin Exp $   */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from @(#)atalk.c       1.1 (Whistle) 6/6/96";
 #else
-__RCSID("$NetBSD: atalk.c,v 1.16 2015/06/06 13:08:31 joerg Exp $");
+__RCSID("$NetBSD: atalk.c,v 1.16.18.1 2019/08/19 15:56:49 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -61,6 +61,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "netstat.h"
+#include "prog_ops.h"
 
 struct ddpcb    ddpcb;
 struct socket   sockb;
@@ -290,7 +291,7 @@
        if (use_sysctl) {
                size_t size = sizeof(ddpstat);
 
-               if (sysctlbyname("net.atalk.ddp.stats", ddpstat, &size,
+               if (prog_sysctlbyname("net.atalk.ddp.stats", ddpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
diff -r ab049f633e04 -r 9c134ae059ee usr.bin/netstat/bpf.c
--- a/usr.bin/netstat/bpf.c     Mon Aug 19 15:53:40 2019 +0000
+++ b/usr.bin/netstat/bpf.c     Mon Aug 19 15:56:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.13 2018/06/26 09:50:42 msaitoh Exp $ */
+/*     $NetBSD: bpf.c,v 1.13.4.1 2019/08/19 15:56:49 martin Exp $      */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
        size_t len = sizeof(bpf_s);
 
        if (use_sysctl) {
-               if (sysctlbyname("net.bpf.stats", &bpf_s, &len, NULL, 0) == -1)
+               if (prog_sysctlbyname("net.bpf.stats", &bpf_s, &len, NULL, 0) == -1)
                        err(1, "net.bpf.stats");
        
                printf("bpf:\n");
@@ -83,7 +83,7 @@
                /* adapted from sockstat.c by Andrew Brown */
 
                sz = CTL_MAXNAME;
-               if (sysctlnametomib("net.bpf.peers", &name[0], &sz) == -1)
+               if (prog_sysctlnametomib("net.bpf.peers", &name[0], &sz) == -1)
                        err(1, "sysctlnametomib: net.bpf.peers");
                namelen = sz;
 
diff -r ab049f633e04 -r 9c134ae059ee usr.bin/netstat/fast_ipsec.c
--- a/usr.bin/netstat/fast_ipsec.c      Mon Aug 19 15:53:40 2019 +0000
+++ b/usr.bin/netstat/fast_ipsec.c      Mon Aug 19 15:56:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fast_ipsec.c,v 1.22 2017/06/29 07:15:27 ozaki-r Exp $ */
+/*     $NetBSD: fast_ipsec.c,v 1.22.8.1 2019/08/19 15:56:49 martin Exp $ */
 /*     $FreeBSD: src/tools/tools/crypto/ipsecstats.c,v 1.1.4.1 2003/06/03 00:13:13 sam Exp $ */
 
 /*-
@@ -33,7 +33,7 @@
 #include <sys/cdefs.h>
 #ifndef lint
 #ifdef __NetBSD__
-__RCSID("$NetBSD: fast_ipsec.c,v 1.22 2017/06/29 07:15:27 ozaki-r Exp $");
+__RCSID("$NetBSD: fast_ipsec.c,v 1.22.8.1 2019/08/19 15:56:49 martin Exp $");
 #endif
 #endif /* not lint*/
 
@@ -62,6 +62,7 @@
 #include <string.h>
 
 #include "netstat.h"
+#include "prog_ops.h"
 
 /*
  * Table-driven mapping from SADB algorithm codes to string names.
@@ -116,7 +117,7 @@
        memset(ipips, 0, sizeof(ipips));
 
        slen = sizeof(ipsecstats);
-       status = sysctlbyname("net.inet.ipsec.ipsecstats", ipsecstats, &slen,
+       status = prog_sysctlbyname("net.inet.ipsec.ipsecstats", ipsecstats, &slen,
                              NULL, 0);
        if (status < 0) {
                if (errno == ENOENT)
@@ -126,22 +127,22 @@
        }
 
        slen = sizeof (ahstats);
-       status = sysctlbyname("net.inet.ah.ah_stats", ahstats, &slen, NULL, 0);
+       status = prog_sysctlbyname("net.inet.ah.ah_stats", ahstats, &slen, NULL, 0);
        if (status < 0 && errno != ENOMEM)
                err(1, "net.inet.ah.ah_stats");
 
        slen = sizeof (espstats);
-       status = sysctlbyname("net.inet.esp.esp_stats", espstats, &slen, NULL, 0);
+       status = prog_sysctlbyname("net.inet.esp.esp_stats", espstats, &slen, NULL, 0);
        if (status < 0 && errno != ENOMEM)
                err(1, "net.inet.esp.esp_stats");
 
        slen = sizeof(ipcs);
-       status = sysctlbyname("net.inet.ipcomp.ipcomp_stats", ipcs, &slen, NULL, 0);
+       status = prog_sysctlbyname("net.inet.ipcomp.ipcomp_stats", ipcs, &slen, NULL, 0);
        if (status < 0 && errno != ENOMEM)
                err(1, "net.inet.ipcomp.ipcomp_stats");
 
        slen = sizeof(ipips);
-       status = sysctlbyname("net.inet.ipip.ipip_stats", ipips, &slen, NULL, 0);
+       status = prog_sysctlbyname("net.inet.ipip.ipip_stats", ipips, &slen, NULL, 0);
        if (status < 0 && errno != ENOMEM)
                err(1, "net.inet.ipip.ipip_stats");
 
diff -r ab049f633e04 -r 9c134ae059ee usr.bin/netstat/inet.c
--- a/usr.bin/netstat/inet.c    Mon Aug 19 15:53:40 2019 +0000
+++ b/usr.bin/netstat/inet.c    Mon Aug 19 15:56:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet.c,v 1.109 2019/05/13 07:48:42 ozaki-r Exp $       */
+/*     $NetBSD: inet.c,v 1.109.2.1 2019/08/19 15:56:49 martin Exp $    */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c       8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet.c,v 1.109 2019/05/13 07:48:42 ozaki-r Exp $");
+__RCSID("$NetBSD: inet.c,v 1.109.2.1 2019/08/19 15:56:49 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -241,7 +241,7 @@
                err(1, "asprintf");
 
        /* get dynamic pcblist node */
-       if (sysctlnametomib(mibname, mib, &namelen) == -1) {
+       if (prog_sysctlnametomib(mibname, mib, &namelen) == -1) {
                if (errno == ENOENT) {
                        *len = 0;
                        return NULL;
@@ -403,7 +403,7 @@
        if (use_sysctl) {
                size_t size = sizeof(tcpstat);
 
-               if (sysctlbyname("net.inet.tcp.stats", tcpstat, &size,
+               if (prog_sysctlbyname("net.inet.tcp.stats", tcpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
@@ -530,7 +530,7 @@
        if (use_sysctl) {
                size_t size = sizeof(udpstat);
 
-               if (sysctlbyname("net.inet.udp.stats", udpstat, &size,
+               if (prog_sysctlbyname("net.inet.udp.stats", udpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
@@ -583,7 +583,7 @@
        if (use_sysctl) {
                size_t size = sizeof(ipstat);
 
-               if (sysctlbyname("net.inet.ip.stats", ipstat, &size,
+               if (prog_sysctlbyname("net.inet.ip.stats", ipstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
@@ -648,7 +648,7 @@
        if (use_sysctl) {
                size_t size = sizeof(icmpstat);
 
-               if (sysctlbyname("net.inet.icmp.stats", icmpstat, &size,
+               if (prog_sysctlbyname("net.inet.icmp.stats", icmpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
@@ -704,7 +704,7 @@
        if (use_sysctl) {
                size_t size = sizeof(igmpstat);
 
-               if (sysctlbyname("net.inet.igmp.stats", igmpstat, &size,
+               if (prog_sysctlbyname("net.inet.igmp.stats", igmpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
@@ -742,7 +742,7 @@
        if (use_sysctl) {
                size_t size = sizeof(carpstat);
 
-               if (sysctlbyname("net.inet.carp.stats", carpstat, &size,
+               if (prog_sysctlbyname("net.inet.carp.stats", carpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
@@ -828,7 +828,7 @@
        if (use_sysctl) {
                size_t size = sizeof(arpstat);
 
-               if (sysctlbyname("net.inet.arp.stats", arpstat, &size,
+               if (prog_sysctlbyname("net.inet.arp.stats", arpstat, &size,
                                 NULL, 0) == -1)
                        return;
        } else {
diff -r ab049f633e04 -r 9c134ae059ee usr.bin/netstat/inet6.c
--- a/usr.bin/netstat/inet6.c   Mon Aug 19 15:53:40 2019 +0000
+++ b/usr.bin/netstat/inet6.c   Mon Aug 19 15:56:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet6.c,v 1.72 2019/05/13 07:48:42 ozaki-r Exp $       */
+/*     $NetBSD: inet6.c,v 1.72.2.1 2019/08/19 15:56:49 martin Exp $    */
 /*     BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp   */
 
 /*
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = "@(#)inet.c     8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet6.c,v 1.72 2019/05/13 07:48:42 ozaki-r Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.72.2.1 2019/08/19 15:56:49 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -416,7 +416,7 @@
        if (use_sysctl) {
                size_t size = sizeof(tcp6stat);
 
-               if (sysctlbyname("net.inet6.tcp6.stats", &tcp6stat, &size,
+               if (prog_sysctlbyname("net.inet6.tcp6.stats", &tcp6stat, &size,
                    NULL, 0) == -1)
                        return;
        } else {
@@ -502,7 +502,7 @@
        if (use_sysctl) {
                size_t size = sizeof(udp6stat);
 
-               if (sysctlbyname("net.inet6.udp6.stats", udp6stat, &size,
+               if (prog_sysctlbyname("net.inet6.udp6.stats", udp6stat, &size,
                    NULL, 0) == -1)
                        return;
        } else {
@@ -646,7 +646,7 @@
        if (use_sysctl) {
                size_t size = sizeof(ip6stat);
 
-               if (sysctlbyname("net.inet6.ip6.stats", ip6stat, &size,
+               if (prog_sysctlbyname("net.inet6.ip6.stats", ip6stat, &size,
                    NULL, 0) == -1)
                        return;
        } else {
@@ -1132,7 +1132,7 @@
        if (use_sysctl) {
                size_t size = sizeof(icmp6stat);
 
-               if (sysctlbyname("net.inet6.icmp6.stats", icmp6stat, &size,
+               if (prog_sysctlbyname("net.inet6.icmp6.stats", icmp6stat, &size,
                    NULL, 0) == -1)
                        return;
        } else {
@@ -1280,7 +1280,7 @@
        if (use_sysctl) {
                size_t size = sizeof(pim6stat);
 
-               if (sysctlbyname("net.inet6.pim6.stats", pim6stat, &size,
+               if (prog_sysctlbyname("net.inet6.pim6.stats", pim6stat, &size,
                    NULL, 0) == -1)
                        return;
         } else {
@@ -1313,7 +1313,7 @@
        if (use_sysctl) {
                size_t size = sizeof(rip6stat);



Home | Main Index | Thread Index | Old Index