Hello community, here is the log from the commit of package netsniff-ng for openSUSE:Factory checked in at 2020-05-26 17:21:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/netsniff-ng (Old) and /work/SRC/openSUSE:Factory/.netsniff-ng.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "netsniff-ng" Tue May 26 17:21:10 2020 rev:6 rq:808095 version:0.6.7 Changes: -------- --- /work/SRC/openSUSE:Factory/netsniff-ng/netsniff-ng.changes 2019-11-10 22:47:46.493895446 +0100 +++ /work/SRC/openSUSE:Factory/.netsniff-ng.new.2738/netsniff-ng.changes 2020-05-26 17:21:25.920247189 +0200 @@ -1,0 +2,12 @@ +Mon May 4 13:49:28 UTC 2020 - Martin Hauke <[email protected]> + +- Update to version 0.6.7 + * trafgen: reset errno before calling sscanf in str2mac + * ifpps: fix iface stat parsing if interface name contains + uppercase characters + * mausezahn: fix display of missing argument error + * mausezahn: support -R to set packet priority + * netsniff-ng: handle various malformed packets in protocol + dissectors + +------------------------------------------------------------------- Old: ---- netsniff-ng-0.6.6.tar.xz New: ---- netsniff-ng-0.6.7.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ netsniff-ng.spec ++++++ --- /var/tmp/diff_new_pack.MO0XJv/_old 2020-05-26 17:21:26.572248591 +0200 +++ /var/tmp/diff_new_pack.MO0XJv/_new 2020-05-26 17:21:26.572248591 +0200 @@ -1,7 +1,7 @@ # # spec file for package netsniff-ng # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2012 Pascal Bleser <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -18,12 +18,12 @@ Name: netsniff-ng -Version: 0.6.6 +Version: 0.6.7 Release: 0 Summary: Network Sniffer for Packet Inspection License: GPL-2.0-only Group: Productivity/Networking/Diagnostic -Url: http://netsniff-ng.org/ +URL: http://netsniff-ng.org/ Source: http://pub.netsniff-ng.org/netsniff-ng/netsniff-ng-%{version}.tar.xz BuildRequires: autoconf BuildRequires: automake ++++++ netsniff-ng-0.6.6.tar.xz -> netsniff-ng-0.6.7.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/.mailmap new/netsniff-ng-0.6.7/.mailmap --- old/netsniff-ng-0.6.6/.mailmap 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/.mailmap 2020-05-04 15:15:32.000000000 +0200 @@ -1 +1,2 @@ Jon Schipp <[email protected]> +Michael R Torres <[email protected]> <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/AUTHORS new/netsniff-ng-0.6.7/AUTHORS --- old/netsniff-ng-0.6.6/AUTHORS 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/AUTHORS 2020-05-04 15:15:32.000000000 +0200 @@ -3,6 +3,7 @@ * arch3y <[email protected]> * Baruch Siach <[email protected]> + * Benoît Ganne <[email protected]> * Christian Wiese <[email protected]> * Daniel Borkmann <[email protected]> * Daniel Roberson <[email protected]> @@ -15,6 +16,7 @@ * Jaroslav Škarvada <[email protected]> * Jesper Dangaard Brouer <[email protected]> * Jia Zhouyang <[email protected]> + * Joachim Nilsson <[email protected]> * Jon Schipp <[email protected]> * Kartik Mistry <[email protected]> * Ken-ichirou MATSUZAWA <[email protected]> @@ -24,7 +26,9 @@ * Markus Amend <[email protected]> * Martin Hauke <[email protected]> * Matteo Croce <[email protected]> + * Michael R Torres <[email protected]> * Michał Purzyński <[email protected]> + * Nathaniel Ferguson <[email protected]> * Nick Grauel <[email protected]> * Oliver Smith <[email protected]> * Paolo Abeni <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/Makefile new/netsniff-ng-0.6.7/Makefile --- old/netsniff-ng-0.6.6/Makefile 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/Makefile 2020-05-04 15:15:32.000000000 +0200 @@ -15,9 +15,9 @@ VERSION = 0 PATCHLEVEL = 6 -SUBLEVEL = 6 +SUBLEVEL = 7 EXTRAVERSION = -NAME = Syro +NAME = Polygon Window TOOLS ?= $(CONFIG_TOOLS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/astraceroute.c new/netsniff-ng-0.6.7/astraceroute.c --- old/netsniff-ng-0.6.6/astraceroute.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/astraceroute.c 2020-05-04 15:15:32.000000000 +0200 @@ -74,17 +74,17 @@ static int assemble_ipv4(uint8_t *packet, size_t len, int ttl, int proto, const struct ctx *ctx, const struct sockaddr *dst, const struct sockaddr *src); -static int assemble_ipv6(uint8_t *packet, size_t len, int ttl, int proto, - const struct ctx *ctx, const struct sockaddr *dst, - const struct sockaddr *src); static int check_ipv4(uint8_t *packet, size_t len, int ttl, int id, const struct sockaddr *ss); static void handle_ipv4(uint8_t *packet, size_t len, int dns_resolv, int latitude); +static int assemble_ipv6(uint8_t *packet, size_t len, int ttl, int proto, + const struct ctx *ctx, const struct sockaddr *dst, + const struct sockaddr *src); static int check_ipv6(uint8_t *packet, size_t len, int ttl, int id, const struct sockaddr *ss); static void handle_ipv6(uint8_t *packet, size_t len, int dns_resolv, - int latitude); + int latitude); static const char *short_options = "H:p:nNf:m:b:i:d:q:x:SAEFPURt:Gl:hv46X:ZuL"; static const struct option long_options[] = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/ifpps.c new/netsniff-ng-0.6.7/ifpps.c --- old/netsniff-ng-0.6.6/ifpps.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/ifpps.c 2020-05-04 15:15:32.000000000 +0200 @@ -245,7 +245,7 @@ if (strstr(buff, ifname_colon) == NULL) continue; - if (sscanf(buff, "%*[a-z0-9_ .-]:%llu%llu%llu%llu%llu%llu" + if (sscanf(buff, "%*[a-zA-Z0-9_ .-]:%llu%llu%llu%llu%llu%llu" "%llu%*u%llu%llu%llu%llu%llu%llu%llu", &stats->rx_bytes, &stats->rx_packets, &stats->rx_errors, &stats->rx_drops, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/mausezahn.8 new/netsniff-ng-0.6.7/mausezahn.8 --- old/netsniff-ng-0.6.6/mausezahn.8 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/mausezahn.8 2020-05-04 15:15:32.000000000 +0200 @@ -79,6 +79,12 @@ .SS -l <IP> Specify the IP address mausezahn should bind to when in interactive mode, default: 0.0.0.0. .PP +.SS -R <PRIO> +Set priority of sent packets. This configures SO_PRIORITY at the socket through +which the packets are sent. Usual priority numbers are 0..15, but the value can +also be a class ID for purposes of Qdisc classification. In that case, a class +ID such is 1234:5678 would be specified as 0x12345678. +.PP .SS -v Verbose mode. Capital \-V is even more verbose. .PP @@ -98,6 +104,9 @@ in seconds (e.g. 100s or 100sec). Note: mops also supports nanosecond delay resolution if you need it (see interactive mode). .PP +.SS -r +Multiply the specified delay with a random value. +.PP .SS -p <length> Pad the raw frame to specified length using zero bytes. Note that for raw layer 2 frames the specified length defines the whole frame length, while for diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/proto_ipv4.c new/netsniff-ng-0.6.7/proto_ipv4.c --- old/netsniff-ng-0.6.6/proto_ipv4.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/proto_ipv4.c 2020-05-04 15:15:32.000000000 +0200 @@ -154,7 +154,7 @@ * check and handle that */ opt_len = *(++opt); - if (opt_len > opts_len) { + if (opt_len < 2 || opt_len > opts_len) { tprintf(", Len (%zd, invalid) ]\n", opt_len); goto out; } else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/proto_lldp.c new/netsniff-ng-0.6.7/proto_lldp.c --- old/netsniff-ng-0.6.6/proto_lldp.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/proto_lldp.c 2020-05-04 15:15:32.000000000 +0200 @@ -88,7 +88,7 @@ static int lldp_print_net_addr(const uint8_t *addr, size_t addrlen) { uint8_t af; - char buf[64]; + char buf[64] = {0}; if (addrlen < 1) return -EINVAL; @@ -99,13 +99,21 @@ case IANA_AF_IPV4: if (addrlen < 4) return -EINVAL; - inet_ntop(AF_INET, addr, buf, sizeof(buf)); + if (inet_ntop(AF_INET, addr, buf, sizeof(buf)) == NULL) { + tprintf("[MALFORMED ADDR]"); + return 0; + } + tprintf("%s", buf); break; case IANA_AF_IPV6: if (addrlen < 16) return -EINVAL; - inet_ntop(AF_INET6, addr, buf, sizeof(buf)); + if (inet_ntop(AF_INET6, addr, buf, sizeof(buf)) == NULL) { + tprintf("[MALFORMED ADDR]"); + return 0; + } + tprintf("%s", buf); break; case IANA_AF_802: @@ -348,7 +356,7 @@ goto out_invalid; sys_cap = EXTRACT_16BIT(tlv_info_str); - tlv_info_str += sizeof(uint32_t); + tlv_info_str += sizeof(uint16_t); en_cap = EXTRACT_16BIT(tlv_info_str); tprintf(" ("); @@ -391,11 +399,15 @@ } tlv_info_str++; + + if (tlv_len - mgmt_alen < sizeof(uint32_t)) + goto out_invalid; tprintf(", Iface Number %u", EXTRACT_32BIT(tlv_info_str)); tlv_info_str += 4; mgmt_oidlen = *tlv_info_str; - if (tlv_len - mgmt_alen - sizeof(uint32_t) - 3 < mgmt_oidlen) + if (tlv_len - mgmt_alen - sizeof(uint32_t) < 3 || + tlv_len - mgmt_alen - sizeof(uint32_t) - 3 < mgmt_oidlen) goto out_invalid; if (mgmt_oidlen > 0) { tprintf(", OID "); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/staging/automops.c new/netsniff-ng-0.6.7/staging/automops.c --- old/netsniff-ng-0.6.6/staging/automops.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/staging/automops.c 2020-05-04 15:15:32.000000000 +0200 @@ -26,7 +26,7 @@ struct automops * automops_init(void) { // Create initial automops element: - struct automops *new_automops = (struct automops*) malloc(sizeof(struct automops)); + struct automops *new_automops = (struct automops*) calloc(1, sizeof(struct automops)); new_automops->next = new_automops; new_automops->prev = new_automops; automops_set_defaults (new_automops); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/staging/layer3.c new/netsniff-ng-0.6.7/staging/layer3.c --- old/netsniff-ng-0.6.6/staging/layer3.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/staging/layer3.c 2020-05-04 15:15:32.000000000 +0200 @@ -133,6 +133,15 @@ fprintf(stderr, "%s", errbuf); exit(EXIT_FAILURE); } + + if (tx.prio != 0 && + setsockopt (libnet_getfd (l), SOL_SOCKET, SO_PRIORITY, &tx.prio, + sizeof tx.prio) < 0) + { + perror("setsockopt SO_PRIORITY"); + exit(EXIT_FAILURE); + } + return l; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/staging/mausezahn.c new/netsniff-ng-0.6.7/staging/mausezahn.c --- old/netsniff-ng-0.6.6/staging/mausezahn.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/staging/mausezahn.c 2020-05-04 15:15:32.000000000 +0200 @@ -34,7 +34,7 @@ int verbose_level = 0; -static const char *short_options = "46hqvVSxra:A:b:B:c:d:E:f:F:l:p:P:t:T:M:Q:X:"; +static const char *short_options = "46hqvVSxra:A:b:B:c:d:E:f:F:l:p:P:R:t:T:M:Q:X:"; static void signal_handler(int number) { @@ -113,6 +113,7 @@ " -l <ip> Listen address to bind to when in interactive mode, default: 0.0.0.0\n" " -4 IPv4 mode (default)\n" " -6 IPv6 mode\n" + " -R <PRIO> Set socket priority\n" " -c <count> Send packet count times, default:1, infinite:0\n" " -d <delay> Apply delay between transmissions. The delay value can be\n" " specified in usec (default, no additional unit needed), or in\n" @@ -224,6 +225,7 @@ tx.packet_mode = 1; // assume we don't care about L2 tx.count = 1; tx.delay = DEFAULT_DELAY; + tx.prio = 0; tx.arg_string[0] = '\0'; // Reset Ethernet parameters of TX: @@ -398,6 +400,7 @@ char hexpld[MAX_PAYLOAD_SIZE*2]; int hexpld_specified=0; long delay; + long prio; char unit; opterr = 1; // let getopt print error message if necessary @@ -413,6 +416,19 @@ tx.eth_type = 0x86dd; ipv6_mode=1; break; + case 'R': + errno = 0; + prio = strtol(optarg, NULL, 0); + if (errno) { + perror("Couldn't parse priority"); + return -1; + } + if (prio < 0 || prio > 0xffffffff) { + perror("Invalid priority value"); + return -1; + } + tx.prio = (int)prio; + break; case 'h': help(); break; @@ -574,8 +590,8 @@ } break; case '?': - if ((optopt == 'a') || (optopt == 'b') || (optopt = 'c') || - (optopt == 'd') || (optopt == 'f') || (optopt = 'p') || + if ((optopt == 'a') || (optopt == 'b') || (optopt == 'c') || + (optopt == 'd') || (optopt == 'f') || (optopt == 'p') || (optopt == 't') || (optopt == 'm')) fprintf (stderr, " mz/getopts: Option -%c requires an argument.\n", optopt); else if (isprint (optopt)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/staging/mz.h new/netsniff-ng-0.6.7/staging/mz.h --- old/netsniff-ng-0.6.6/staging/mz.h 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/staging/mz.h 2020-05-04 15:15:32.000000000 +0200 @@ -340,6 +340,7 @@ int packet_mode; // 0 means use LIBNET_LINK_ADV, 1 means LIBNET_RAW4 unsigned int count; // 0 means infinite, 1 is default unsigned int delay; // Delay in microseconds, 0 means no delay (default) + unsigned int prio; // Socket priority, 0 is default char arg_string[MAX_PAYLOAD_SIZE]; // Argument-string when -t is used // Ethernet and 802.3 parameters diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netsniff-ng-0.6.6/str.c new/netsniff-ng-0.6.7/str.c --- old/netsniff-ng-0.6.6/str.c 2019-05-09 09:22:22.000000000 +0200 +++ new/netsniff-ng-0.6.7/str.c 2020-05-04 15:15:32.000000000 +0200 @@ -143,6 +143,7 @@ if (len < 6) return -ENOSPC; + errno = 0; count = sscanf(str, "%02X:%02X:%02X:%02X:%02X:%02X", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]);
