Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package traceroute for openSUSE:Factory checked in at 2023-12-22 22:40:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/traceroute (Old) and /work/SRC/openSUSE:Factory/.traceroute.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "traceroute" Fri Dec 22 22:40:47 2023 rev:11 rq:1134468 version:2.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/traceroute/traceroute.changes 2023-11-13 22:15:58.420684251 +0100 +++ /work/SRC/openSUSE:Factory/.traceroute.new.28375/traceroute.changes 2023-12-22 22:40:53.663034060 +0100 @@ -1,0 +2,12 @@ +Tue Dec 19 18:58:12 UTC 2023 - Andreas Stieger <andreas.stie...@gmx.de> + +- update to 2.1.5: + * Parse interface information (rfc5837) for ICMP extensions + * Add `fastopen' tcp module option (cookie negotiation only) + * Complete tcp module option `mss' to discover possible mss + clamping along the path being traced. + * Complete tcp module option `info' to print returned tcp header + options too (all those that can be set or altered by `-O' for + tcp module). + +------------------------------------------------------------------- Old: ---- traceroute-2.1.3.tar.gz New: ---- traceroute-2.1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ traceroute.spec ++++++ --- /var/tmp/diff_new_pack.GUVqji/_old 2023-12-22 22:40:56.191127075 +0100 +++ /var/tmp/diff_new_pack.GUVqji/_new 2023-12-22 22:40:56.207127665 +0100 @@ -17,7 +17,7 @@ Name: traceroute -Version: 2.1.3 +Version: 2.1.5 Release: 0 Summary: Packet route path tracing utility License: GPL-2.0-or-later @@ -27,9 +27,9 @@ Patch0: traceroute-autotools.patch Patch1: traceroute-secure_getenv.patch BuildRequires: automake -Provides: net-tools:%{_sbindir}/%{name} -Provides: tcptraceroute +Provides: tcptraceroute = %{version} Obsoletes: tcptraceroute <= 1.5.beta7 +Provides: net-tools:%{_sbindir}/%{name} %description Traceroute tracks the route packets taken from an IP network on their way to a given host. ++++++ traceroute-2.1.3.tar.gz -> traceroute-2.1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/CREDITS new/traceroute-2.1.5/CREDITS --- old/traceroute-2.1.3/CREDITS 2023-02-13 18:51:01.000000000 +0100 +++ new/traceroute-2.1.5/CREDITS 2023-12-13 21:10:36.000000000 +0100 @@ -22,6 +22,7 @@ Sergey Salnikov (s...@salnikov.ru) Richard Sheehan (richardshee...@users.sourceforge.net) Eric Dumazet (eduma...@google.com) +Francois Rigault <francois.riga...@amadeus.com> ... maybe you too? ;) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/ChangeLog new/traceroute-2.1.5/ChangeLog --- old/traceroute-2.1.3/ChangeLog 2023-08-30 00:47:05.000000000 +0200 +++ new/traceroute-2.1.5/ChangeLog 2023-12-18 00:38:42.000000000 +0100 @@ -1,12 +1,43 @@ +2023-12-18 Dmitry Butskoy <dmi...@butskoy.name> - 2.1.5 + + * Fix rfc5837 parsing (Francois Rigault) + + +2023-12-13 Dmitry Butskoy <dmi...@butskoy.name> - 2.1.4 + + * Parse interface information (rfc5837) for ICMP extensions + + * Add `fastopen' tcp module option (cookie negotiation only) + + * Complete tcp module option `mss' to discover possible mss clamping + along the path being traced (idea and testing from Francois Rigault). + The argument is optional now. + + Changed mss is printed once in a form of `M=NUM' at the first probe + it was detected on. (Actually, the mss clamping performed by + some previous hop). + + Note, some routers may return too short original fragment + in the time exceeded message, making the check impossible. + Besides that the responses may come in a different order. + All this can lead to a later place of the report + (using -N 1 can help for the order). + + * Complete tcp module option `info' to print returned tcp header options too + (all those that can be set or altered by `-O' for tcp module). + + 2023-08-30 Dmitry Butskoy <dmi...@butskoy.name> - 2.1.3 * Fix command line parsing in wrappers. + 2023-02-13 Dmitry Butskoy <dmi...@butskoy.name> - 2.1.2 * Fix unprivileged ICMP tracerouting with Linux kernel >= 6.1 (Eric Dumazet, SF bug #14) + 2022-12-27 Dmitry Butskoy <dmi...@butskoy.name> - 2.1.1 * Interpret ipv4-mapped ipv6 addresses (::ffff:A.B.C.D) as true ipv4. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/Make.rules new/traceroute-2.1.5/Make.rules --- old/traceroute-2.1.3/Make.rules 2016-02-20 21:39:46.000000000 +0100 +++ new/traceroute-2.1.5/Make.rules 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ # # Copyright (c) 2000, 2001, 2007 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/Makefile new/traceroute-2.1.5/Makefile --- old/traceroute-2.1.3/Makefile 2013-08-22 15:27:51.000000000 +0200 +++ new/traceroute-2.1.5/Makefile 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ # # Copyright (c) 2000, 2001 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/VERSION new/traceroute-2.1.5/VERSION --- old/traceroute-2.1.3/VERSION 2023-08-30 00:41:38.000000000 +0200 +++ new/traceroute-2.1.5/VERSION 2023-12-16 01:40:22.000000000 +0100 @@ -1 +1 @@ -#define VERSION 2.1.3 +#define VERSION 2.1.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/chvers.sh new/traceroute-2.1.5/chvers.sh --- old/traceroute-2.1.3/chvers.sh 2013-12-07 17:32:30.000000000 +0100 +++ new/traceroute-2.1.5/chvers.sh 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2000, 2001 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/default.rules new/traceroute-2.1.5/default.rules --- old/traceroute-2.1.3/default.rules 2013-09-09 16:20:06.000000000 +0200 +++ new/traceroute-2.1.5/default.rules 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ # # Copyright (c) 2000, 2001, 2007 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/include/version.h new/traceroute-2.1.5/include/version.h --- old/traceroute-2.1.3/include/version.h 2013-09-28 16:22:44.000000000 +0200 +++ new/traceroute-2.1.5/include/version.h 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/libsupp/clif.c new/traceroute-2.1.5/libsupp/clif.c --- old/traceroute-2.1.3/libsupp/clif.c 2016-02-14 23:31:26.000000000 +0100 +++ new/traceroute-2.1.5/libsupp/clif.c 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2003 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: LGPL v2.1 or any later See COPYING.LIB for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/libsupp/clif.h new/traceroute-2.1.5/libsupp/clif.h --- old/traceroute-2.1.3/libsupp/clif.h 2013-08-06 17:20:33.000000000 +0200 +++ new/traceroute-2.1.5/libsupp/clif.h 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2003 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: LGPL v2.1 or any later See COPYING.LIB for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/store.sh new/traceroute-2.1.5/store.sh --- old/traceroute-2.1.3/store.sh 2013-08-25 16:46:40.000000000 +0200 +++ new/traceroute-2.1.5/store.sh 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2000, 2001 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/as_lookups.c new/traceroute-2.1.5/traceroute/as_lookups.c --- old/traceroute-2.1.3/traceroute/as_lookups.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/as_lookups.c 2023-12-09 03:50:31.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/csum.c new/traceroute-2.1.5/traceroute/csum.c --- old/traceroute-2.1.3/traceroute/csum.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/csum.c 2023-12-09 03:50:31.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/extension.c new/traceroute-2.1.5/traceroute/extension.c --- old/traceroute-2.1.3/traceroute/extension.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/extension.c 2023-12-18 00:35:04.000000000 +0100 @@ -2,6 +2,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <ctype.h> #include "traceroute.h" @@ -26,8 +27,11 @@ uint8_t data[0]; }; -#define MPLS_CLASS 1 -#define MPLS_C_TYPE 1 +#define MPLS_CLASS 1 +#define MPLS_C_TYPE 1 + +#define IFACE_INFO_CLASS 2 +#define IFACE_INFO_NAME_LEN 64 #define do_snprintf(CURR, END, FMT, ARGS...) \ @@ -37,6 +41,101 @@ } while (0) +/* rfc 5837 stuff */ + +static int print_iface_info (struct icmp_ext_object *obj, char *buf, size_t length) { + uint32_t *ui; + char tmp[128]; /* enough: 4 + (4 + 16) + 64 + 4 = 92 */ + size_t data_len; + char *curr = buf, *end = buf + length; + char *start; + const char *roles[] = { "INC", "SUB", "OUT", "NXT" }; + + + /* Copy data into temporary array of enough length + to avoid boundary checks on each step. + */ + data_len = ntohs (obj->length) - sizeof (*obj); + if (data_len > sizeof (tmp)) return 0; + + memset (tmp, 0, sizeof (tmp)); + memcpy (tmp, obj->data, data_len); + + ui = (uint32_t *) tmp; + + + do_snprintf (curr, end, "%s:", roles[(obj->c_type >> 6) & 0x03]); + start = curr; + + if (obj->c_type & 0x08) /* index */ + do_snprintf (curr, end, "%u", ntohl (*ui++)); + + if (obj->c_type & 0x04) { /* IP address */ + sockaddr_any addr; + void *ptr; + size_t len; + uint16_t afi = ntohl (*ui++) >> 16; + + memset (&addr, 0, sizeof (addr)); + + if (afi == 1) { /* ipv4 */ + addr.sa.sa_family = AF_INET; + ptr = &addr.sin.sin_addr; + len = sizeof (addr.sin.sin_addr); + } + else if (afi == 2) { /* ipv6 */ + addr.sa.sa_family = AF_INET6; + ptr = &addr.sin6.sin6_addr; + len = sizeof (addr.sin6.sin6_addr); + } else + return 0; + + memcpy (ptr, ui, len); + ui += len / sizeof (*ui); + + do_snprintf (curr, end, "%s%s", (curr > start) ? "," : "", addr2str (&addr)); + } + + if (obj->c_type & 0x02) { /* name */ + uint8_t *name = (uint8_t *) ui; + uint8_t len = *name; + char str[IFACE_INFO_NAME_LEN * 4]; /* enough... */ + char *p = str; + static char hex[16] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; + int i; + + if (!len || (len % sizeof (uint32_t)) || len > IFACE_INFO_NAME_LEN) + return 0; + + for (i = 1; i < len; i++) { /* name[0] is length */ + int ch = name[i]; + + if (!ch) break; + else if (!isascii (ch) || !isgraph (ch) || ch == '%' || ch == '"') { + *p++ = '%'; + *p++ = hex[(ch >> 4) & 0x0f]; + *p++ = hex[ch & 0x0f]; + } else + *p++ = ch; + } + *p++ = '\0'; + + do_snprintf (curr, end, "%s\"%s\"", (curr > start) ? "," : "", str); + + ui += len / sizeof (*ui); + } + + if (obj->c_type & 0x01) /* mtu */ + do_snprintf (curr, end, "%smtu=%u", (curr > start) ? "," : "", ntohl (*ui++)); + + + if (ui > (uint32_t *) (tmp + data_len)) + return 0; + + return (curr - buf); +} + + static int try_extension (probe *pb, char *buf, size_t len) { struct icmp_ext_header *iext = (struct icmp_ext_header *) buf; char str[1024]; @@ -80,7 +179,7 @@ if (obj->class == MPLS_CLASS && obj->c_type == MPLS_C_TYPE && n >= 1 - ) { /* people prefer MPLS to be parsed... */ + ) { /* people prefer MPLS (rfc4950) to be parsed... */ do_snprintf (curr, end, "MPLS:"); @@ -96,6 +195,12 @@ } } + else if (obj->class == IFACE_INFO_CLASS && + (i = print_iface_info (obj, curr, end - curr)) > 0 + ) { + curr += i; /* successfully parsed */ + + } else { /* common case... */ do_snprintf (curr, end, "%u/%u:", obj->class, obj->c_type); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/mod-icmp.c new/traceroute-2.1.5/traceroute/mod-icmp.c --- old/traceroute-2.1.3/traceroute/mod-icmp.c 2016-03-07 01:51:54.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/mod-icmp.c 2023-12-09 03:50:31.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/mod-raw.c new/traceroute-2.1.5/traceroute/mod-raw.c --- old/traceroute-2.1.3/traceroute/mod-raw.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/mod-raw.c 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/mod-tcp.c new/traceroute-2.1.5/traceroute/mod-tcp.c --- old/traceroute-2.1.3/traceroute/mod-tcp.c 2016-02-18 21:33:46.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/mod-tcp.c 2023-12-13 05:05:57.000000000 +0100 @@ -1,11 +1,12 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. */ +#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> @@ -26,6 +27,11 @@ #define IP_MTU 14 #endif +#ifndef TCPOPT_FASTOPEN +#define TCPOPT_FASTOPEN 34 +#define TCPOLEN_FASTOPEN_BASE 2 +#endif + static sockaddr_any dest_addr = {{ 0, }, }; static unsigned int dest_port = 0; @@ -51,8 +57,10 @@ static int flags = 0; /* & 0xff == tcp_flags ... */ static int sysctl = 0; static int reuse = 0; -static unsigned int mss = 0; +static int mss = -1; +static int check_mss = 0; static int info = 0; +static int fastopen = 0; #define FL_FLAGS 0x0100 #define FL_ECN 0x0200 @@ -75,14 +83,24 @@ { "cwr", TH_CWR }, }; -static char *names_by_flags (unsigned int flags) { + +static char *print_tcp_info (struct tcphdr *tcp, size_t len) { int i; - char str[64]; /* enough... */ + char str[128]; /* enough... */ char *curr = str; - char *end = str + sizeof (str) / sizeof (*str); + char *end = str + (sizeof (str) / sizeof (*str) - 1); + const char *p; + unsigned int flags; + uint8_t *ptr; + + if (len < sizeof (struct tcphdr) || + len != tcp->doff << 2 + ) return NULL; + + + flags = TH_FLAGS(tcp); for (i = 0; i < sizeof (tcp_flags) / sizeof (*tcp_flags); i++) { - const char *p; if (!(flags & tcp_flags[i].flag)) continue; @@ -90,11 +108,48 @@ for (p = tcp_flags[i].name; *p && curr < end; *curr++ = *p++) ; } + + ptr = (uint8_t *) (tcp + 1); + len -= sizeof (struct tcphdr); + + while (len > 1) { + int op = *ptr, oplen = ptr[1]; + char buf[16]; + const char *name = NULL; + + switch (op) { + case TCPOPT_EOL: len = 0; continue; /* no more... */ + case TCPOPT_NOP: oplen = 1; break; + case TCPOPT_MAXSEG: + if (oplen == TCPOLEN_MAXSEG && oplen <= len) { + uint16_t rcv_mss = ntohs (*((uint16_t *) (ptr + 2))); + snprintf (buf, sizeof (buf), "mss=%u", rcv_mss); + name = buf; + } + break; + case TCPOPT_SACK_PERMITTED: if (oplen == TCPOLEN_SACK_PERMITTED) name = "sack"; break; + case TCPOPT_TIMESTAMP: if (oplen == TCPOLEN_TIMESTAMP) name = "timestamps"; break; + case TCPOPT_WINDOW: if (oplen == TCPOLEN_WINDOW) name = "window_scaling"; break; + case TCPOPT_FASTOPEN: if (oplen >= TCPOLEN_FASTOPEN_BASE) name = "fastopen"; break; + } + + if (name) { + if (curr > str && curr < end) *curr++ = ','; + for (p = name; *p && curr < end; *curr++ = *p++) ; + } + + if (len < oplen) break; + len -= oplen; + ptr += oplen; + } + + *curr = '\0'; return strdup (str); } + static int set_tcp_flag (CLIF_option *optn, char *arg) { int i; @@ -126,6 +181,16 @@ return 0; } +static int set_mss (CLIF_option *optn, char *arg) { + + check_mss = 1; + + if (arg) + return CLIF_set_uint (optn, arg); + + return 0; +} + static CLIF_option tcp_options[] = { { 0, "syn", 0, "Set tcp flag SYN (default if no other " "tcp flags specified)", set_tcp_flag, 0, 0, 0 }, @@ -148,16 +213,19 @@ { 0, "window_scaling", 0, "window_scaling option for tcp", set_flag, (void *) FL_WSCALE, 0, CLIF_ABBREV }, { 0, "sysctl", 0, "Use current sysctl (/proc/sys/net/*) setting " - "for the tcp options and ecn. Always set by default " + "for the tcp options above and ecn. Always set by default " "(with \"syn\") if nothing else specified", CLIF_set_flag, &sysctl, 0, 0 }, + { 0, "fastopen", 0, "Use fastopen tcp option (when syn, cookie negotiation only)", + CLIF_set_flag, &fastopen, 0, 0 }, { 0, "reuse", 0, "Allow to reuse local port numbers " "for the huge workloads (SO_REUSEADDR)", CLIF_set_flag, &reuse, 0, 0 }, - { 0, "mss", "NUM", "Use value of %s for maxseg tcp option (when syn)", - CLIF_set_uint, &mss, 0, 0 }, - { 0, "info", 0, "Print tcp flags of final tcp replies when target " - "host is reached. Useful to determine whether " + { 0, "mss", "NUM", "Use value of %s (or unchanged) for maxseg tcp option (when syn), " + "and discover its clamping along the path being traced", + set_mss, &mss, 0, CLIF_OPTARG }, + { 0, "info", 0, "Print tcp flags and options of final tcp replies " + "when target host is reached. Useful to determine whether " "an application listens the port etc.", CLIF_set_flag, &info, 0, 0 }, CLIF_END_OPTION @@ -232,6 +300,8 @@ mtu -= af == AF_INET ? sizeof (struct iphdr) : sizeof (struct ip6_hdr); mtu -= sizeof (struct tcphdr); + if (mss < 0) mss = mtu; + if (!raw_can_connect ()) { /* work-around for buggy kernels */ close (raw_sk); @@ -318,7 +388,7 @@ if (flags & TH_SYN) { *ptr++ = TCPOPT_MAXSEG; /* 2 */ *ptr++ = TCPOLEN_MAXSEG; /* 4 */ - *((uint16_t *) ptr) = htons (mss ? mss : mtu); + *((uint16_t *) ptr) = htons (mss); ptr += sizeof (uint16_t); } @@ -353,6 +423,19 @@ *ptr++ = 2; /* assume some corect value... */ } + if (fastopen && (flags & TH_SYN)) { + *ptr++ = TCPOPT_FASTOPEN; /* 34 */ + if (flags & TH_ACK) { + /* cookie size of 8 is defined in kernel's linux/tcp.h */ + *ptr++ = TCPOLEN_FASTOPEN_BASE + 2 * sizeof (uint32_t); + *((uint32_t *) ptr) = random_seq (); ptr += sizeof (uint32_t); + *((uint32_t *) ptr) = random_seq (); ptr += sizeof (uint32_t); + } else + *ptr++ = TCPOLEN_FASTOPEN_BASE + 0; /* 2 */ + *ptr++ = TCPOPT_NOP; /* 1 */ + *ptr++ = TCPOPT_NOP; /* 1 */ + } + csum_len = ptr - buf; @@ -468,12 +551,28 @@ if (!pb) return NULL; + if (check_mss && + err && + len >= sizeof (*tcp) + TCPOLEN_MAXSEG + ) { + uint8_t *ptr = (uint8_t *) (tcp + 1); + + if (ptr[0] == TCPOPT_MAXSEG && ptr[1] == TCPOLEN_MAXSEG) { + uint16_t seen_mss = ntohs (*((uint16_t *) (ptr + 2))); + if (mss != seen_mss) { + put_err (pb, "M=%u", seen_mss); + mss = seen_mss; /* print just once */ + } + } + } + + if (!err) { pb->final = 1; if (info) - pb->ext = names_by_flags (TH_FLAGS(tcp)); + pb->ext = print_tcp_info (tcp, len); } return pb; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/mod-tcpconn.c new/traceroute-2.1.5/traceroute/mod-tcpconn.c --- old/traceroute-2.1.3/traceroute/mod-tcpconn.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/mod-tcpconn.c 2023-12-09 03:50:31.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/mod-udp.c new/traceroute-2.1.5/traceroute/mod-udp.c --- old/traceroute-2.1.3/traceroute/mod-udp.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/mod-udp.c 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/module.c new/traceroute-2.1.5/traceroute/module.c --- old/traceroute-2.1.3/traceroute/module.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/module.c 2023-12-09 03:50:31.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/poll.c new/traceroute-2.1.5/traceroute/poll.c --- old/traceroute-2.1.3/traceroute/poll.c 2022-12-27 01:00:18.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/poll.c 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/random.c new/traceroute-2.1.5/traceroute/random.c --- old/traceroute-2.1.3/traceroute/random.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/random.c 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. @@ -22,7 +22,7 @@ unsigned int random_seq (void) { - /* To not worry about RANDOM_MAX and precision... */ + /* Not to worry about RANDOM_MAX and precision... */ return (rand () << 16) ^ (rand () << 8) ^ rand () ^ (rand () >> 8); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/time.c new/traceroute-2.1.5/traceroute/time.c --- old/traceroute-2.1.3/traceroute/time.c 2016-02-14 22:04:50.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/time.c 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/traceroute.8 new/traceroute-2.1.5/traceroute/traceroute.8 --- old/traceroute-2.1.3/traceroute/traceroute.8 2016-03-07 23:27:47.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/traceroute.8 2023-12-13 04:26:22.000000000 +0100 @@ -298,7 +298,9 @@ .B MPLS:L=\fIlabel\fB,E=\fIexp_use\fB,S=\fIstack_bottom\fB,T=\fITTL (more objects separated by .B / -). +). The Interface Information (rfc5837) is shown parsed as well, in a following form: +.B \fR{\fBINC\fR|\fBSUB\fR|\fBOUT\fR|\fBNXT\fR}\fB:\fIindex\fB,\fIIP_addr\fB,"\fIname\fB",mtu=\fIMTU\fB +(all four fields may be missing). .TP .B \-A, \-\-as\-path\-lookups Perform AS path lookups in routing registries and print results @@ -483,16 +485,47 @@ .BR ecn . Always set by default, if nothing else specified. .TP -.B mss\fR=\fInum +.B fastopen +Use fastopen tcp option (when +.BR syn ), +for initial cookie negotiation only. +.TP +.B mss\fR=[\fInum\fR] Use value of .I num -for maxseg tcp header option (when -.BR syn ). +(or unchanged) for maxseg tcp header option (when +.BR syn ), +and discover its clamping along the path being traced. +New changed +.I mss +is printed once in a form of +.B M=\fINUM +at the first probe on which it was detected. +Note, some routers may return too short original fragment +in the time exceeded message, making the check impossible. +Besides that the responses may come in a different order. +All this can lead to a later place of the report +(using +.BR \-N\ 1 +can help for the order). .TP .B info -Print tcp flags of final tcp replies when the target host is reached. +Print tcp flags and supported options +of final tcp replies when the target host is reached. Allows to determine whether an application listens the port and other useful things. +Supported tcp options are all that can be set by +.BR \-T\ \-O , +ie. +.IR mss , +.IR sack , +.IR timestamps , +.IR window_scaling +and +.IR fastopen , +with the similar output format (a value for +.IR mss +and just presence for others). .P Default options is .BR syn,sysctl . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/traceroute.c new/traceroute-2.1.5/traceroute/traceroute.c --- old/traceroute-2.1.3/traceroute/traceroute.c 2023-02-13 18:37:06.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/traceroute.c 2023-12-10 05:27:41.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. @@ -169,6 +169,20 @@ } +void put_err (probe *pb, const char *format, ...) { + va_list ap; + char *curr = pb->err_str; + char *end = pb->err_str + sizeof (pb->err_str) - 1; + + /* It can already contain something when `--mtu' or `-T -O mss' */ + while (curr < end && *curr) curr++; + + va_start (ap, format); + vsnprintf (curr, end - curr, format, ap); + va_end (ap); +} + + /* Set initial parameters according to how we was called */ static void check_progname (const char *name) { @@ -259,7 +273,7 @@ static char addr2str_buf[INET6_ADDRSTRLEN]; -static const char *addr2str (const sockaddr_any *addr) { +const char *addr2str (const sockaddr_any *addr) { getnameinfo (&addr->sa, sizeof (*addr), addr2str_buf, sizeof (addr2str_buf), 0, 0, NI_NUMERICHOST); @@ -1226,8 +1240,6 @@ void parse_icmp_res (probe *pb, int type, int code, int info) { - char *str = NULL; - char buf[sizeof (pb->err_str)]; if (af == AF_INET) { @@ -1235,60 +1247,60 @@ if (code == ICMP_EXC_TTL) return; } - else if (type == ICMP_DEST_UNREACH) { + + if (type == ICMP_DEST_UNREACH) { switch (code) { case ICMP_UNREACH_NET: case ICMP_UNREACH_NET_UNKNOWN: case ICMP_UNREACH_ISOLATED: case ICMP_UNREACH_TOSNET: - str = "!N"; + put_err (pb, "!N"); break; case ICMP_UNREACH_HOST: case ICMP_UNREACH_HOST_UNKNOWN: case ICMP_UNREACH_TOSHOST: - str = "!H"; + put_err (pb, "!H"); break; case ICMP_UNREACH_NET_PROHIB: case ICMP_UNREACH_HOST_PROHIB: case ICMP_UNREACH_FILTER_PROHIB: - str = "!X"; + put_err (pb, "!X"); break; case ICMP_UNREACH_PORT: /* dest host is reached */ - str = ""; break; case ICMP_UNREACH_PROTOCOL: - str = "!P"; + put_err (pb, "!P"); break; case ICMP_UNREACH_NEEDFRAG: - snprintf (buf, sizeof (buf), "!F-%d", info); - str = buf; + put_err (pb, "!F-%d", info); break; case ICMP_UNREACH_SRCFAIL: - str = "!S"; + put_err (pb, "!S"); break; case ICMP_UNREACH_HOST_PRECEDENCE: - str = "!V"; + put_err (pb, "!V"); break; case ICMP_UNREACH_PRECEDENCE_CUTOFF: - str = "!C"; + put_err (pb, "!C"); break; default: - snprintf (buf, sizeof (buf), "!<%u>", code); - str = buf; + put_err (pb, "!<%u>", code); break; } - } + + } else + put_err (pb, "!<%u-%u>", type, code); } else if (af == AF_INET6) { @@ -1297,49 +1309,37 @@ if (code == ICMP6_TIME_EXCEED_TRANSIT) return; } - else if (type == ICMP6_DST_UNREACH) { + + if (type == ICMP6_DST_UNREACH) { switch (code) { case ICMP6_DST_UNREACH_NOROUTE: - str = "!N"; + put_err (pb, "!N"); break; case ICMP6_DST_UNREACH_BEYONDSCOPE: case ICMP6_DST_UNREACH_ADDR: - str = "!H"; + put_err (pb, "!H"); break; case ICMP6_DST_UNREACH_ADMIN: - str = "!X"; + put_err (pb, "!X"); break; case ICMP6_DST_UNREACH_NOPORT: /* dest host is reached */ - str = ""; break; default: - snprintf (buf, sizeof (buf), "!<%u>", code); - str = buf; + put_err (pb, "!<%u>", code); break; } } - else if (type == ICMP6_PACKET_TOO_BIG) { - snprintf (buf, sizeof (buf), "!F-%d", info); - str = buf; - } - } - - - if (!str) { - snprintf (buf, sizeof (buf), "!<%u-%u>", type, code); - str = buf; - } - - if (*str) { - strncpy (pb->err_str, str, sizeof (pb->err_str)); - pb->err_str[sizeof (pb->err_str) - 1] = '\0'; + else if (type == ICMP6_PACKET_TOO_BIG) + put_err (pb, "!F-%d", info); + else + put_err (pb, "!<%u-%u>", type, code); } pb->final = 1; @@ -1351,7 +1351,7 @@ static void parse_local_res (probe *pb, int ee_errno, int info) { if (ee_errno == EMSGSIZE && info != 0) { - snprintf (pb->err_str, sizeof(pb->err_str)-1, "!F-%d", info); + put_err (pb, "!F-%d", info); pb->final = 1; return; } @@ -1523,7 +1523,7 @@ but fill its `err_str' by the info obtained. Ugly, but easy... */ memset (pb, 0, sizeof (*pb)); - snprintf (pb->err_str, sizeof(pb->err_str)-1, "F=%d", ee->ee_info); + put_err (pb, "F=%d", ee->ee_info); return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute/traceroute.h new/traceroute-2.1.5/traceroute/traceroute.h --- old/traceroute-2.1.3/traceroute/traceroute.h 2016-02-14 22:13:48.000000000 +0100 +++ new/traceroute-2.1.5/traceroute/traceroute.h 2023-12-10 05:03:15.000000000 +0100 @@ -1,6 +1,6 @@ /* Copyright (c) 2006, 2007 Dmitry Butskoy - <b...@citadel.stu.neva.ru> + <dmi...@butskoy.name> License: GPL v2 or any later See COPYING for the status of this software. @@ -28,7 +28,7 @@ int sk; int seq; char *ext; - char err_str[16]; /* assume enough */ + char err_str[32]; /* assume enough */ }; typedef struct probe_struct probe; @@ -58,8 +58,10 @@ #define DEF_RAW_PROT 253 /* for experimentation and testing, rfc3692 */ -void error (const char *str) __attribute__((noreturn)); -void error_or_perm (const char *str) __attribute__((noreturn)); +void error (const char *str) __attribute__ ((noreturn)); +void error_or_perm (const char *str) __attribute__ ((noreturn)); +void put_err (probe *pb, const char *format, ...) __attribute__ ((format (printf, 2, 3))); +const char *addr2str (const sockaddr_any *addr); double get_time (void); void tune_socket (int sk); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/traceroute.spec new/traceroute-2.1.5/traceroute.spec --- old/traceroute-2.1.3/traceroute.spec 2023-08-30 00:41:38.000000000 +0200 +++ new/traceroute-2.1.5/traceroute.spec 2023-12-16 01:40:22.000000000 +0100 @@ -1,6 +1,6 @@ Summary: Traces the route taken by packets over an IPv4/IPv6 network Name: traceroute -Version: 2.1.3 +Version: 2.1.5 Release: 1%{?dist} Group: Applications/Internet License: GPLv2+ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/wrappers/Makefile new/traceroute-2.1.5/wrappers/Makefile --- old/traceroute-2.1.3/wrappers/Makefile 2013-08-22 15:16:17.000000000 +0200 +++ new/traceroute-2.1.5/wrappers/Makefile 2023-12-09 03:50:30.000000000 +0100 @@ -1,6 +1,6 @@ # # Copyright (c) 2007 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/wrappers/lft new/traceroute-2.1.5/wrappers/lft --- old/traceroute-2.1.3/wrappers/lft 2013-07-13 14:28:57.000000000 +0200 +++ new/traceroute-2.1.5/wrappers/lft 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2007 Dmitry K. Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/wrappers/tcptraceroute new/traceroute-2.1.5/wrappers/tcptraceroute --- old/traceroute-2.1.3/wrappers/tcptraceroute 2023-08-30 00:42:42.000000000 +0200 +++ new/traceroute-2.1.5/wrappers/tcptraceroute 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2007 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/wrappers/tracepath new/traceroute-2.1.5/wrappers/tracepath --- old/traceroute-2.1.3/wrappers/tracepath 2023-08-30 00:42:51.000000000 +0200 +++ new/traceroute-2.1.5/wrappers/tracepath 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2008 Dmitry Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/wrappers/traceproto new/traceroute-2.1.5/wrappers/traceproto --- old/traceroute-2.1.3/wrappers/traceproto 2023-08-30 00:43:01.000000000 +0200 +++ new/traceroute-2.1.5/wrappers/traceproto 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2007 Dmitry K. Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/traceroute-2.1.3/wrappers/traceroute-nanog new/traceroute-2.1.5/wrappers/traceroute-nanog --- old/traceroute-2.1.3/wrappers/traceroute-nanog 2023-08-30 00:43:08.000000000 +0200 +++ new/traceroute-2.1.5/wrappers/traceroute-nanog 2023-12-09 03:50:30.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (c) 2007 Dmitry K. Butskoy -# <b...@citadel.stu.neva.ru> +# <dmi...@butskoy.name> # License: GPL v2 or any later # # See COPYING for the status of this software. ++++++ traceroute-secure_getenv.patch ++++++ --- /var/tmp/diff_new_pack.GUVqji/_old 2023-12-22 22:40:56.975155923 +0100 +++ /var/tmp/diff_new_pack.GUVqji/_new 2023-12-22 22:40:56.995156658 +0100 @@ -1,5 +1,7 @@ ---- traceroute-2.0.20.orig/traceroute/traceroute.h -+++ traceroute-2.0.20/traceroute/traceroute.h +Index: traceroute-2.1.5/traceroute/traceroute.h +=================================================================== +--- traceroute-2.1.5.orig/traceroute/traceroute.h ++++ traceroute-2.1.5/traceroute/traceroute.h @@ -57,6 +57,13 @@ typedef struct tr_module_struct tr_modul #define DEF_DCCP_PORT DEF_START_PORT /* is it a good choice?... */ #define DEF_RAW_PROT 253 /* for experimentation and testing, rfc3692 */ @@ -12,10 +14,12 @@ +# endif +#endif - void error (const char *str) __attribute__((noreturn)); - void error_or_perm (const char *str) __attribute__((noreturn)); ---- traceroute-2.0.20.orig/traceroute/as_lookups.c -+++ traceroute-2.0.20/traceroute/as_lookups.c + void error (const char *str) __attribute__ ((noreturn)); + void error_or_perm (const char *str) __attribute__ ((noreturn)); +Index: traceroute-2.1.5/traceroute/as_lookups.c +=================================================================== +--- traceroute-2.1.5.orig/traceroute/as_lookups.c ++++ traceroute-2.1.5/traceroute/as_lookups.c @@ -39,10 +39,10 @@ const char *get_as_path (const char *que struct addrinfo *res; int ret; @@ -29,8 +33,10 @@ if (!service) service = DEF_RADB_SERVICE; ---- traceroute-2.0.20.orig/libsupp/clif.c -+++ traceroute-2.0.20/libsupp/clif.c +Index: traceroute-2.1.5/libsupp/clif.c +=================================================================== +--- traceroute-2.1.5.orig/libsupp/clif.c ++++ traceroute-2.1.5/libsupp/clif.c @@ -398,7 +398,7 @@ int CLIF_parse_cmdline (int argc, char * unsigned int dirty_flags = 0; int dirty_plus = 0; @@ -40,8 +46,10 @@ (parse_flags & CLIF_POSIX); curr.argc = argc; ---- traceroute-2.0.20.orig/libsupp/clif.h -+++ traceroute-2.0.20/libsupp/clif.h +Index: traceroute-2.1.5/libsupp/clif.h +=================================================================== +--- traceroute-2.1.5.orig/libsupp/clif.h ++++ traceroute-2.1.5/libsupp/clif.h @@ -118,4 +118,12 @@ extern int CLIF_arg_func (CLIF_argument { "V", "version", 0, "Print version info and exit", \ CLIF_version_handler, STR, 0, CLIF_EXTRA | CLIF_EXIT }