From nobody Thu Feb 8 16:55:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TW34n21NMz5B205; Thu, 8 Feb 2024 16:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TW34n1hLMz4Sws; Thu, 8 Feb 2024 16:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707411305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJ7PZopbaLb/ysulyz+AwlkwQFhMbyx51plMiVZ1rxs=; b=Ub/WcA5GvdyBgMy9AAaNicgmbFDu8QNLRABUWHZrGYJE7dDDByGwHyH3fbAK3FCmfnfkko BDtVDi2sFTNyE+Misovs7TRQhLKx/RnrrvN0nFJbh7wVNdOl8YpjYOnEvsOSbooeVaMUEP FeLWqsY++dIlK/I+ZgjcOTRyvq7MBlh7tLCXqVKayOWBdUFzHmuKcvtfbZdUgX4QjcXQ93 kHVMODPF0adq2by+7EcND45D3wWF2hghznweg8sgmtypyFmEAxTJNtIhglkjBbowNpDpnr sctX7if7cVaEhnJNNKLByxEHDE79VxSZng7Z4SyYWBzE9kzEW1MhzoVNqzmrPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707411305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJ7PZopbaLb/ysulyz+AwlkwQFhMbyx51plMiVZ1rxs=; b=PB6BzlXqXWd+xCnw+SWGJc0VbU2zC1+4oU0Ux7EPXHTpfhW7zc08tdEZEuTwJG/nVP9eU8 no2j//4S+EqHVgiKSRpkg9FONGf+92IlDQii0aURMf9OBhBLMYujSi5kvtVaWzPA1gBZUu p1rGwHeSjURjBFsme5/myZGBS+ACM9fcd0CTBBQF9DqWHhxXrTHywxAqhKnPCeDd3+Sw9D 9a+aOvjql8aHIOMehJrSB59/0I+8phLSanCgw9MhYY9XhaQJepQC02S6zVKAT7WzRn2pJX Cr4IFIIfo6TK/N7B3THNMmYf+7W1D5tV87A8Y05Alf2xAjApz9jpIYVFLYqrXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707411305; a=rsa-sha256; cv=none; b=TmuzGf379Gr9io8w1NMRgMm0dd0bBJWZYtlm1wg6zqC/tXt0XARz5p/Kgmtjs6Ef95Evt2 Y0oJZx/aJlqmLwgEGHbEIGdvMbV/R+rwWmkgplnJUsvmOVeC2/2sbWlwcrEU9a3VecbwSu /fOWOPCrfujPRWOS5n2Cj6CQx3hDYn8at1FnAcaiTetBkXc5U5hprSIERPdoPouz0y8DsD V9OabijXUq2JVeCnzIqPbKgtBk7HQMsIjhIzsbDzlPINAAg1jMa2Zisi3POW+dF2WO0G8R hU5UlUkMpFxjOxDt3K3/s07EGzLEgnLgitkZbmV28UNOZoYZKB4w3UojzdPUyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TW34n0mPNzyDs; Thu, 8 Feb 2024 16:55:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 418Gt5Xj054652; Thu, 8 Feb 2024 16:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 418Gt5ke054649; Thu, 8 Feb 2024 16:55:05 GMT (envelope-from git) Date: Thu, 8 Feb 2024 16:55:05 GMT Message-Id: <202402081655.418Gt5ke054649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9b7a920a12a9 - main - traceroute: move from contrib to usr.sbin List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b7a920a12a9377b9c8227f72748ab32fbbb4822 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9b7a920a12a9377b9c8227f72748ab32fbbb4822 commit 9b7a920a12a9377b9c8227f72748ab32fbbb4822 Author: Lexi Winter AuthorDate: 2024-02-03 13:10:09 +0000 Commit: Warner Losh CommitDate: 2024-02-08 16:52:42 +0000 traceroute: move from contrib to usr.sbin traceroute hasn't had a vendor import since 2002, while since then it's had several significant FreeBSD-specific commits. Since it's unlikely another vendor import will happen, and to make the merge of traceroute6 into traceroute easier, import traceroute into usr.sbin. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1100 --- contrib/traceroute/CHANGES | 148 --------------------- contrib/traceroute/FILES | 37 ------ contrib/traceroute/FREEBSD-upgrade | 36 ----- contrib/traceroute/INSTALL | 105 --------------- contrib/traceroute/README | 29 ---- contrib/traceroute/VERSION | 1 - contrib/traceroute/mean.awk | 12 -- contrib/traceroute/median.awk | 29 ---- contrib/traceroute/rip_output.c | 73 ---------- usr.sbin/traceroute/Makefile | 14 +- {contrib => usr.sbin}/traceroute/as.c | 0 {contrib => usr.sbin}/traceroute/as.h | 0 .../traceroute/findsaddr-socket.c | 0 {contrib => usr.sbin}/traceroute/findsaddr.h | 0 {contrib => usr.sbin}/traceroute/ifaddrlist.c | 0 {contrib => usr.sbin}/traceroute/ifaddrlist.h | 0 {contrib => usr.sbin}/traceroute/traceroute.8 | 0 {contrib => usr.sbin}/traceroute/traceroute.c | 3 - {contrib => usr.sbin}/traceroute/traceroute.h | 0 19 files changed, 1 insertion(+), 486 deletions(-) diff --git a/contrib/traceroute/CHANGES b/contrib/traceroute/CHANGES deleted file mode 100644 index 25ef7bedc43f..000000000000 --- a/contrib/traceroute/CHANGES +++ /dev/null @@ -1,148 +0,0 @@ -@(#) $Id: CHANGES,v 1.23 2000/12/14 06:53:11 leres Exp $ (LBL) - -v1.4 Wed Dec 13 22:50:35 PST 2000 - -- Add an option to use icmp echo instead of udp datagrams. - -- Add HPUX and Linux support. - -- Handle hex argument values as suggested by John Hawkinson - (jhawk@mit.edu) - -- Added flags to set the first ttl and to set the don't fragment bit. - -- Add a local autoconf macro to check for routines in libraries; the - autoconf version is broken (it only puts the library name in the - cache variable name). Thanks to John Hawkinson. - -- Add a local autoconf macro to check for types; the autoconf version - is broken (it uses grep instead of actually compiling a code fragment). - -- Attempt to detect "egcs" versions of gcc. - -- Fix problems caused by savestr(). - -- Detect when there are more interfaces than we can deal with. Thanks - to Guy Harris guy@netapp.com. - -- Accommodate changes made to FreeBSD 3.2-RELEASE network headers files. - -- The ip header offset needs to be byte swapped under Solaris on the - intel as well. Reported by John McDermott (jjm@jkintl.com) Also byte - ip length and offset for linux. - -- In wait_for_reply(), use passed socket instead of global one. Thanks - to Richard Kettlewell (richard.kettlewell@kewill.com) - -- Check for IFF_LOOPBACK as a define or an enum (concession to linux). - Reported by Robert Bihlmeyer (robbe@orcus.priv.at) - -- Increase size of SIOCGIFCONF buffer to accommodate systems with lots - of virtual interfaces. Ignore sun virtual interfaces. Suggested by - Ian Donaldson (iand@aone.com.au) - -- Always calculate icmp checksums when using -I. Reported by Soumen - (sbiswas@novell.com) - -- Documentation fix for description of -p. Thanks to Jeffrey C Honig - (jch@bsdi.com) - -- Enable ip checksums for Solaris 2.6 and higher (since they seem to - work correctly now). - -- Avoid problems when broken routers return 0.0.0.0 as their source - address. Thanks to John Hawkinson (jhawk@bbnplanet.com) - -- Canonicalize hostname if gethostname() doesn't return a domain. - -- Add -z flag (pause msecs) to allow optional pause between probes. - Suggested by Dave Morrison (drmorris@uplanet.com) - -- Fix max packet length test. - -- Use "/dev/null" instead of "." for file descriptor fodder. - Suggested by Tim Robbins (fyre@box3n.gumbynet.org) - -- Watch for a NULL argv[0]. Suggested by Tim Robbins. - -- Be careful with hostname legnths. - -- Print RFC1191 Path MTU Discovery value on "needfrag" unreachables. - -- Limit port size to 16 bits. Suggested by Tim Robbins. - -- Limit wait time to 24 hours. - -- Modified linux specific struct ipovly definition to avoid problems - with 64 bit systems. Problem reported by Uros Prestor - (uros@turbolinux.com) - -- Use kernel routing tables to determine correct source address. - Three styles are supported: bsd/socket, solaris/mib and linux. - -- Fix configure to recognize older versions of Solaris. - -v1.3.2 Thu Sep 26 18:06:16 PDT 1996 - -- Rewrite source routing code to eliminate a number of problems on - systems using raw ip options. Also pad options with a noop so gateway - addresses are aligned. - -- Don't call inet_ntoa() twice in the same printf(). Thanks to NetBSD - via Bill Fenner (fenner@parc.xerox.com) - -- Decode "administratively prohibited filter" icmp code and print - numeric value for unknown codes. Thanks to Bill Fenner. - -v1.3.1 Wed Sep 18 21:08:16 PDT 1996 - -- Some systems (e.g. AIX) need sys/select.h. Thanks to Brett Hogden - (hogden@rge.com) - -- Byte swap ip header length under Solaris. (This has no effect on the - sparc but is required on the i386.) - -- Made optional packet length control total size of packet. - -v1.3 Mon Sep 16 14:55:44 PDT 1996 - -- Overrun buffer security fixes. Thanks to Bill Fenner - (fenner@parc.xerox.com) - -- Wait for response packet relative to start of probe. Thanks to Bill - Fenner. - -- Fix bug that prevented changing the packet size. Thanks to Gregory - Decker (gdecker@nate.dcrt.nih.gov) - -- Add support for RAW_OPTIONS (e.g. 4.4 BSD systems such as BSD/OS and - FreeBSD) thanks to Jeffrey C Honig (jch@bsdi.com) - -- Remove ip header byte swap fix from v1.2; most kernels swap the ip - header length in the kernel (and it causes OSF3 to crash). - -- Fix to not exit when the number of probes is set to 1 (i.e. "-q 1") - -- Improve autoconf configuration. - -v1.2 Tue Oct 17 23:50:05 PDT 1995 - -- Convert to autoconf and ansify. - -- Byte swap ip header length for little endian machines. Fix thanks to - Y Badri (yb@greybox.demon.co.uk). - -v1.1 Thu Jun 15 02:32:55 PDT 1995 - -- Check for too many arguments. - -- Recode to make timing of packet's round trip more obvious and to - tighten up code. - -- Ifdef IP_OPTIONS code. - -- Display time in microseconds. - -v1.0 Tue Feb 28 23:50:05 PDT 1989 - -- Initial public release. diff --git a/contrib/traceroute/FILES b/contrib/traceroute/FILES deleted file mode 100644 index 7a585ba9cedc..000000000000 --- a/contrib/traceroute/FILES +++ /dev/null @@ -1,37 +0,0 @@ -CHANGES -FILES -INSTALL -Makefile.in -README -VERSION -aclocal.m4 -config.guess -config.sub -configure -configure.in -findsaddr-generic.c -findsaddr-linux.c -findsaddr-mib.c -findsaddr-socket.c -findsaddr.h -ifaddrlist.c -ifaddrlist.h -install-sh -lbl/gnuc.h -lbl/os-solaris2.h -lbl/os-sunos4.h -linux-include/netinet/in_systm.h -linux-include/netinet/ip.h -linux-include/netinet/ip_icmp.h -linux-include/netinet/ip_var.h -linux-include/netinet/udp.h -linux-include/netinet/udp_var.h -mean.awk -median.awk -mkdep -rip_output.c -strerror.c -traceroute.8 -traceroute.c -traceroute.h -usleep.c diff --git a/contrib/traceroute/FREEBSD-upgrade b/contrib/traceroute/FREEBSD-upgrade deleted file mode 100644 index 4ed42321d26e..000000000000 --- a/contrib/traceroute/FREEBSD-upgrade +++ /dev/null @@ -1,36 +0,0 @@ -This directory contains virgin copies of the original distribution files -on a "vendor" branch. Do not, under any circumstances, attempt to upgrade -the files in this directory via patches and a cvs commit. - -To upgrade to a newer version of traceroute, when it is available: - - 1. Unpack the new version into an empty directory. - [Do not make ANY changes to the files.] - - 2. Use the command: - cvs import -I linux-include \ - -m 'Virgin import of LBL traceroute v' \ - src/contrib/traceroute LBL v - - For example, to do the import of version 1.3.2, I might have typed: - cvs import -I linux-include \ - -m 'Virgin import of LBL traceroute v1.3.2' \ - src/contrib/traceroute LBL v1_3_2 - - 3. Follow the instructions printed out in step 2 to resolve any - conflicts between local FreeBSD changes and the newer version. - -Do not, under any circumstances, deviate from this procedure. - -To make local changes to traceroute, simply patch and commit to the main -branch (aka HEAD). Never make local changes on the LBL branch. - -All local changes should be submitted to "traceroute@ee.lbl.gov" for -inclusion in the next vendor release of traceroute. - -(The "SANE_PRECISION" patch has been submitted and rejected.) - -(The extensive modifications for TCP and GRE probes have not been -submitted.) - -fenner@freebsd.org - 30 Sep 1996 diff --git a/contrib/traceroute/INSTALL b/contrib/traceroute/INSTALL deleted file mode 100644 index 45d361dc4a0e..000000000000 --- a/contrib/traceroute/INSTALL +++ /dev/null @@ -1,105 +0,0 @@ -@(#) $Id: INSTALL,v 1.13 2000/11/23 20:07:29 leres Exp $ (LBL) - -Traceroute is known to build and run under SunOS 4.1.4 and Solaris 5.4. -If you are running a really old kernel, see the instructions under the -title "KERNEL MODIFICATIONS" further down. - -To build traceroute, first customize any paths in Makefile.in, then run -"./configure" (a shell script). The configure script will determine -your system attributes and generate an appropriate Makefile from -Makefile.in. Next run "make". If everything goes well you can su to -root and run "make install" and "make install-man". Note that traceroute -must be installed setuid to root or run as root. - -If configure fails for some reason and decide to submit a bug report to -traceroute@ee.lbl.gov, please include a copy of config.log. - -You will need an ANSI C compiler to build libpcap. The configure script -will abort if your compiler is not ANSI compliant. If this happens, use -the GNU C compiler, available via anonymous ftp: - - ftp://prep.ai.mit.edu/pub/gnu/gcc-*.tar.gz - -If you get the error message: - - traceroute: unknown protocol icmp - -it usually means you're missing the icmp line in /etc/protocols. - -If you are using Solaris 2.5.1 (and possibly higher), traceroute cannot -calculate checksums; configure automatically changes the default to -reflect this. The kernel updates the ip_id field with some unknown -value and the ip_off field with the IP_DF bit. Also, if the the udp -uh_sum field is non-zero, it gets updated with the value of the uh_ulen -field... This means that the icmp echo option (-I flag) is not as -useful. - -KERNEL MODIFICATIONS --------------------- -If yor have a really old system, it may be necessary to modify your -kernel before traceroute will work. If you want to hack on your kernel, -a modified version of the routine rip_output (normally found in the -file /sys/netinet/raw_ip.c) can be found in rip_output.c. This code may -or may not resemble the code in your kernel. It may offer you a place -to start but we make no promises. If you do hack your kernel, remember -to test everything that uses raw ip sockets (e.g., ping and -egpup/gated) & make sure they still work. We wish you the best of luck -and you're on your own. - -Some older kernels forward icmp packets that have a ttl of zero. If -your system has this bug, you might want to fix it while you're in the -kernel. (This bug appears in all releases of BSD up to but not -including 4.3tahoe. If your version of netinet/ip_icmp.c is any earlier -than 7.3 (April, '87), it has the bug.) The fix is just to add the -line: - - ip->ip_ttl = MAXTTL; - -after the line: - - ip->ip_src = t; - -(or anywhere before the call to icmp_send) in routine icmp_reflect. - -If you're running this on a pre-4.3bsd system (e.g., SunOS 3) that -strips ip headers from icmp messages, add -DARCHAIC to CFLAGS in the -Makefile. Also note that rip_output contains a conditional for a -4.2/4.3 change in the location of a raw socket's protocol number. I've -checked this under 4.3 & SunOS 3 but you should double-check your -system to make sure the appropriate branch of the #if is taken (check -the line that assigned to ip->ip_p in your system's original -rip_output). - - -FILES ------ -CHANGES - description of differences between releases -FILES - list of files exported as part of the distribution -INSTALL - this file -Makefile.in - compilation rules (input to the configure script) -README - description of distribution -VERSION - version of this release -aclocal.m4 - autoconf macros -config.guess - autoconf support -config.sub - autoconf support -configure - configure script (run this first) -configure.in - configure script source -findsaddr-generic.c - generic source address code -findsaddr-linux.c - linux source address code -findsaddr-socket.c - socket based soruce address code -findsaddr.h - source address prototypes -ifaddrlist.c - inet address routines -ifaddrlist.h - inet address prototypes -install-sh - BSD style install script -lbl/gnuc.h - gcc macros and defines -lbl/os-*.h - os dependent defines and prototypes -linux-include/* - network include files missing on Linux -mean.awk - awk script to print out the mean time along a route -median.awk - awk script to print out the median time along a route -mkdep - construct Makefile dependency list -rip_output.c - sample rip_output() from /sys/netinet/raw_ip.c -strerror.c - emulation routine -traceroute.8 - manual entry -traceroute.c - main program -traceroute.h - global prototypes -usleep.c - missing system call emulation diff --git a/contrib/traceroute/README b/contrib/traceroute/README deleted file mode 100644 index bd4df4cb8295..000000000000 --- a/contrib/traceroute/README +++ /dev/null @@ -1,29 +0,0 @@ -@(#) $Id: README,v 1.9 2000/09/16 05:32:01 leres Exp $ (LBL) - -TRACEROUTE 1.4 -Lawrence Berkeley National Laboratory -Network Research Group -traceroute@ee.lbl.gov -ftp://ftp.ee.lbl.gov/traceroute.tar.gz - -Traceroute is a system administrators utility to trace the route -ip packets from the current system take in getting to some -destination system. See the comments at the front of the -program for a description of its use. - -This program uses raw ip sockets and must be run as root (or installed -setuid to root). - -A couple of awk programs to massage the traceroute output are -included. "mean.awk" and "median.awk" compute the mean and median time -to each hop, respectively. I've found that something like - - traceroute -q 7 foo.somewhere >t - awk -f median.awk t | xgraph - -can give you a quick picture of the bad spots on a long path (median is -usually a better noise filter than mean). - -Problems, bugs, questions, desirable enhancements, source code -contributions, etc., should be sent to the email address -"traceroute@ee.lbl.gov". diff --git a/contrib/traceroute/VERSION b/contrib/traceroute/VERSION deleted file mode 100644 index 4044959ea471..000000000000 --- a/contrib/traceroute/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.4a12+FreeBSD diff --git a/contrib/traceroute/mean.awk b/contrib/traceroute/mean.awk deleted file mode 100644 index 2d5e37820694..000000000000 --- a/contrib/traceroute/mean.awk +++ /dev/null @@ -1,12 +0,0 @@ -/^ *[0-9]/ { - # print out the average time to each hop along a route. - tottime = 0; n = 0; - for (f = 5; f <= NF; ++f) { - if ($f == "ms") { - tottime += $(f - 1) - ++n - } - } - if (n > 0) - print $1, tottime/n, median -} diff --git a/contrib/traceroute/median.awk b/contrib/traceroute/median.awk deleted file mode 100644 index 5935bad4ff4b..000000000000 --- a/contrib/traceroute/median.awk +++ /dev/null @@ -1,29 +0,0 @@ -/^ *[0-9]/ { - # print out the median time to each hop along a route. - tottime = 0; n = 0; - for (f = 5; f <= NF; ++f) { - if ($f == "ms") { - ++n - time[n] = $(f - 1) - } - } - if (n > 0) { - # insertion sort the times to find the median - for (i = 2; i <= n; ++i) { - v = time[i]; j = i - 1; - while (time[j] > v) { - time[j+1] = time[j]; - j = j - 1; - if (j < 0) - break; - } - time[j+1] = v; - } - if (n > 1 && (n % 2) == 0) - median = (time[n/2] + time[(n/2) + 1]) / 2 - else - median = time[(n+1)/2] - - print $1, median - } -} diff --git a/contrib/traceroute/rip_output.c b/contrib/traceroute/rip_output.c deleted file mode 100644 index 0b092b1e8e2f..000000000000 --- a/contrib/traceroute/rip_output.c +++ /dev/null @@ -1,73 +0,0 @@ -/* A sample version of rip_output() from /sys/netinet/raw_ip.c */ - -rip_output(m, so) - register struct mbuf *m; - struct socket *so; -{ - register struct ip *ip; - int error; - struct rawcb *rp = sotorawcb(so); - struct sockaddr_in *sin; -#if BSD>=43 - short proto = rp->rcb_proto.sp_protocol; -#else - short proto = so->so_proto->pr_protocol; -#endif - /* - * if the protocol is IPPROTO_RAW, the user handed us a - * complete IP packet. Otherwise, allocate an mbuf for a - * header and fill it in as needed. - */ - if (proto != IPPROTO_RAW) { - /* - * Calculate data length and get an mbuf - * for IP header. - */ - int len = 0; - struct mbuf *m0; - - for (m0 = m; m; m = m->m_next) - len += m->m_len; - - m = m_get(M_DONTWAIT, MT_HEADER); - if (m == 0) { - m = m0; - error = ENOBUFS; - goto bad; - } - m->m_off = MMAXOFF - sizeof(struct ip); - m->m_len = sizeof(struct ip); - m->m_next = m0; - - ip = mtod(m, struct ip *); - ip->ip_tos = 0; - ip->ip_off = 0; - ip->ip_p = proto; - ip->ip_len = sizeof(struct ip) + len; - ip->ip_ttl = MAXTTL; - } else - ip = mtod(m, struct ip *); - - if (rp->rcb_flags & RAW_LADDR) { - sin = (struct sockaddr_in *)&rp->rcb_laddr; - if (sin->sin_family != AF_INET) { - error = EAFNOSUPPORT; - goto bad; - } - ip->ip_src.s_addr = sin->sin_addr.s_addr; - } else - ip->ip_src.s_addr = 0; - - ip->ip_dst = ((struct sockaddr_in *)&rp->rcb_faddr)->sin_addr; - -#if BSD>=43 - return (ip_output(m, rp->rcb_options, &rp->rcb_route, - (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST)); -#else - return (ip_output(m, (struct mbuf *)0, &rp->rcb_route, - (so->so_options & SO_DONTROUTE) | IP_ALLOWBROADCAST)); -#endif -bad: - m_freem(m); - return (error); -} diff --git a/usr.sbin/traceroute/Makefile b/usr.sbin/traceroute/Makefile index 8ea7ee22d19a..fd013be9ba9a 100644 --- a/usr.sbin/traceroute/Makefile +++ b/usr.sbin/traceroute/Makefile @@ -1,16 +1,12 @@ .include -TRACEROUTE_DISTDIR?= ${SRCTOP}/contrib/traceroute -.PATH: ${TRACEROUTE_DISTDIR} - PACKAGE= runtime PROG= traceroute MAN= traceroute.8 -SRCS= as.c version.c traceroute.c ifaddrlist.c findsaddr-udp.c +SRCS= as.c traceroute.c ifaddrlist.c findsaddr-udp.c BINOWN= root BINMODE=4555 -CLEANFILES= version.c CFLAGS+= -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKIO_H=1 \ -DHAVE_NET_ROUTE_H=1 -DHAVE_NET_IF_DL_H=1 \ @@ -36,14 +32,6 @@ LIBADD+= cap_dns CFLAGS+=-DWITH_CASPER .endif -CFLAGS+= -I${TRACEROUTE_DISTDIR} - WARNS?= 3 -version.c: ${TRACEROUTE_DISTDIR}/VERSION - @rm -f ${.TARGET} - head -1 ${TRACEROUTE_DISTDIR}/VERSION | \ - sed -e 's/.*/char version[] = "&";/' \ - > ${.TARGET} - .include diff --git a/contrib/traceroute/as.c b/usr.sbin/traceroute/as.c similarity index 100% rename from contrib/traceroute/as.c rename to usr.sbin/traceroute/as.c diff --git a/contrib/traceroute/as.h b/usr.sbin/traceroute/as.h similarity index 100% rename from contrib/traceroute/as.h rename to usr.sbin/traceroute/as.h diff --git a/contrib/traceroute/findsaddr-socket.c b/usr.sbin/traceroute/findsaddr-socket.c similarity index 100% rename from contrib/traceroute/findsaddr-socket.c rename to usr.sbin/traceroute/findsaddr-socket.c diff --git a/contrib/traceroute/findsaddr.h b/usr.sbin/traceroute/findsaddr.h similarity index 100% rename from contrib/traceroute/findsaddr.h rename to usr.sbin/traceroute/findsaddr.h diff --git a/contrib/traceroute/ifaddrlist.c b/usr.sbin/traceroute/ifaddrlist.c similarity index 100% rename from contrib/traceroute/ifaddrlist.c rename to usr.sbin/traceroute/ifaddrlist.c diff --git a/contrib/traceroute/ifaddrlist.h b/usr.sbin/traceroute/ifaddrlist.h similarity index 100% rename from contrib/traceroute/ifaddrlist.h rename to usr.sbin/traceroute/ifaddrlist.h diff --git a/contrib/traceroute/traceroute.8 b/usr.sbin/traceroute/traceroute.8 similarity index 100% rename from contrib/traceroute/traceroute.8 rename to usr.sbin/traceroute/traceroute.8 diff --git a/contrib/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c similarity index 99% rename from contrib/traceroute/traceroute.c rename to usr.sbin/traceroute/traceroute.c index 643caedc4c34..b8dcc423ebde 100644 --- a/contrib/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -2146,9 +2146,6 @@ pkt_compare(const u_char *a, int la, const u_char *b, int lb) { void usage(void) { - extern char version[]; - - Fprintf(stderr, "Version %s\n", version); Fprintf(stderr, "Usage: %s [-adDeEFInrSvx] [-A as_server] [-f first_ttl] [-g gateway]\n" "\t[-i iface] [-m max_ttl] [-M first_ttl] [-p port] [-P proto]\n" diff --git a/contrib/traceroute/traceroute.h b/usr.sbin/traceroute/traceroute.h similarity index 100% rename from contrib/traceroute/traceroute.h rename to usr.sbin/traceroute/traceroute.h