Source-Changes-HG archive

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

[src/netbsd-9]: src/usr.sbin/traceroute Pull up following revision(s) (reques...



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

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

        usr.sbin/traceroute/ifaddrlist.c: revision 1.11
        usr.sbin/traceroute/traceroute_rumpops.c: revision 1.2
        usr.sbin/traceroute/traceroute_hostops.c: revision 1.2
        usr.sbin/traceroute/Makefile: revision 1.20
        usr.sbin/traceroute/prog_ops.h: revision 1.2

traceroute: Add indirection of symbol to remove clash with sanitizers

Add indirection and symbol renaming under MKSANITIZER for the linked in
version of getifaddrs.

diffstat:

 usr.sbin/traceroute/Makefile             |  6 +++++-
 usr.sbin/traceroute/ifaddrlist.c         |  7 ++++---
 usr.sbin/traceroute/prog_ops.h           |  8 +++++++-
 usr.sbin/traceroute/traceroute_hostops.c |  5 +++--
 usr.sbin/traceroute/traceroute_rumpops.c |  5 +++--
 5 files changed, 22 insertions(+), 9 deletions(-)

diffs (138 lines):

diff -r 866e45a51177 -r 2e4ba749ca3e usr.sbin/traceroute/Makefile
--- a/usr.sbin/traceroute/Makefile      Mon Aug 19 15:47:00 2019 +0000
+++ b/usr.sbin/traceroute/Makefile      Mon Aug 19 15:49:52 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.19 2011/09/11 01:06:26 christos Exp $     
+#      $NetBSD: Makefile,v 1.19.44.1 2019/08/19 15:49:52 martin Exp $  
 
 USE_FORT?= yes # network client
 
@@ -24,6 +24,10 @@
 RUMPSRCS= getifaddrs.c
 CPPFLAGS+= -DRUMP_ACTION
 
+SANITIZER_RENAME_CLASSES+=     rump
+SANITIZER_RENAME_FILES.rump+=  ${PROG}_rumpops.c ${RUMPSRCS}
+SANITIZER_RENAME_SYMBOL.rump+= getifaddrs
+
 AWKS=  median.awk mean.awk 
 
 .include <bsd.prog.mk>
diff -r 866e45a51177 -r 2e4ba749ca3e usr.sbin/traceroute/ifaddrlist.c
--- a/usr.sbin/traceroute/ifaddrlist.c  Mon Aug 19 15:47:00 2019 +0000
+++ b/usr.sbin/traceroute/ifaddrlist.c  Mon Aug 19 15:49:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ifaddrlist.c,v 1.10 2011/09/11 01:06:26 christos Exp $ */
+/*     $NetBSD: ifaddrlist.c,v 1.10.44.1 2019/08/19 15:49:52 martin Exp $      */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -40,7 +40,7 @@
     "@(#) Header: ifaddrlist.c,v 1.2 97/04/22 13:31:05 leres Exp  (LBL)";
     "@(#) Id: ifaddrlist.c,v 1.9 2000/11/23 20:01:55 leres Exp  (LBL)";
 #else
-__RCSID("$NetBSD: ifaddrlist.c,v 1.10 2011/09/11 01:06:26 christos Exp $");
+__RCSID("$NetBSD: ifaddrlist.c,v 1.10.44.1 2019/08/19 15:49:52 martin Exp $");
 #endif
 #endif
 
@@ -75,6 +75,7 @@
 #endif
 
 #include "ifaddrlist.h"
+#include "prog_ops.h"
 
 /* Not all systems have IFF_LOOPBACK */
 #ifdef IFF_LOOPBACK
@@ -94,7 +95,7 @@
        struct ifaddrlist *al = NULL, *nal;
        size_t i = 0, maxal = 10;
 
-       if (getifaddrs(&ifap) != 0)
+       if (prog_getifaddrs(&ifap) != 0)
                goto out;
 
        if ((al = malloc(maxal * sizeof(*al))) == NULL)
diff -r 866e45a51177 -r 2e4ba749ca3e usr.sbin/traceroute/prog_ops.h
--- a/usr.sbin/traceroute/prog_ops.h    Mon Aug 19 15:47:00 2019 +0000
+++ b/usr.sbin/traceroute/prog_ops.h    Mon Aug 19 15:49:52 2019 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: prog_ops.h,v 1.1 2010/12/15 00:09:41 pooka Exp $      */
+/*      $NetBSD: prog_ops.h,v 1.1.48.1 2019/08/19 15:49:52 martin Exp $        */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <poll.h>
+#include <ifaddrs.h>
 
 struct prog_ops {
        int (*op_init)(void);
@@ -54,6 +55,10 @@
 
        int (*op_sysctl)(const int *, u_int, void *, size_t *,
                         const void *, size_t);
+
+       /* Indirection needed for sanitizers. */
+
+       int (*op_getifaddrs)(struct ifaddrs **);
 };
 extern const struct prog_ops prog_ops;
 
@@ -68,5 +73,6 @@
 #define prog_connect prog_ops.op_connect
 #define prog_getsockname prog_ops.op_getsockname
 #define prog_sysctl prog_ops.op_sysctl
+#define prog_getifaddrs prog_ops.op_getifaddrs
 
 #endif /* _PROG_OPS_H_ */
diff -r 866e45a51177 -r 2e4ba749ca3e usr.sbin/traceroute/traceroute_hostops.c
--- a/usr.sbin/traceroute/traceroute_hostops.c  Mon Aug 19 15:47:00 2019 +0000
+++ b/usr.sbin/traceroute/traceroute_hostops.c  Mon Aug 19 15:49:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traceroute_hostops.c,v 1.1 2010/12/15 00:09:41 pooka Exp $     */
+/*     $NetBSD: traceroute_hostops.c,v 1.1.48.1 2019/08/19 15:49:52 martin Exp $       */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: traceroute_hostops.c,v 1.1 2010/12/15 00:09:41 pooka Exp $");
+__RCSID("$NetBSD: traceroute_hostops.c,v 1.1.48.1 2019/08/19 15:49:52 martin Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -52,4 +52,5 @@
        .op_connect = connect,
        .op_getsockname = getsockname,
        .op_sysctl = sysctl,
+       .op_getifaddrs = getifaddrs,
 };
diff -r 866e45a51177 -r 2e4ba749ca3e usr.sbin/traceroute/traceroute_rumpops.c
--- a/usr.sbin/traceroute/traceroute_rumpops.c  Mon Aug 19 15:47:00 2019 +0000
+++ b/usr.sbin/traceroute/traceroute_rumpops.c  Mon Aug 19 15:49:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: traceroute_rumpops.c,v 1.1 2010/12/15 00:09:42 pooka Exp $     */
+/*     $NetBSD: traceroute_rumpops.c,v 1.1.48.1 2019/08/19 15:49:52 martin Exp $       */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: traceroute_rumpops.c,v 1.1 2010/12/15 00:09:42 pooka Exp $");
+__RCSID("$NetBSD: traceroute_rumpops.c,v 1.1.48.1 2019/08/19 15:49:52 martin Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -56,4 +56,5 @@
        .op_connect =   rump_sys_connect,
        .op_getsockname=rump_sys_getsockname,
        .op_sysctl =    rump_sys___sysctl,
+       .op_getifaddrs =        getifaddrs,
 };



Home | Main Index | Thread Index | Old Index