lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5677DBB6.3070008@iogearbox.net>
Date:	Mon, 21 Dec 2015 12:00:06 +0100
From:	Daniel Borkmann <daniel@...earbox.net>
To:	Phil Sutter <phil@....cc>, Stephen Hemminger <shemming@...cade.com>
CC:	netdev@...r.kernel.org
Subject: Re: [iproute PATCH v2] ip{,6}tunnel: have a shared stats parser/printer

On 12/18/2015 11:58 AM, Phil Sutter wrote:
> This has a slight side-effect of not aborting when /proc/net/dev is
> malformed, but OTOH stats are not parsed for uninteresting interfaces.
>
> Signed-off-by: Phil Sutter <phil@....cc>
> ---
> Changes since v1:
> - Fix conflict resolution (sscan from 'buf' instead of 'ptr').
[...]

Hmm, did you actually compile that?

The code is still the same as in v1 ... the only thing added is the "Changes since v1"
description. ;)

[...]
> +void tnl_print_stats(const char *buf)
> +{
> +	unsigned long rx_bytes, rx_packets, rx_errs, rx_drops,
> +		      rx_fifo, rx_frame,
> +		      tx_bytes, tx_packets, tx_errs, tx_drops,
> +		      tx_fifo, tx_colls, tx_carrier, rx_multi;
> +
> +	if (sscanf(ptr, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",

   s/ptr/buf/

> +	           &rx_bytes, &rx_packets, &rx_errs, &rx_drops,
> +	           &rx_fifo, &rx_frame, &rx_multi,
> +	           &tx_bytes, &tx_packets, &tx_errs, &tx_drops,
> +	           &tx_fifo, &tx_colls, &tx_carrier) != 14)
> +		return;
> +
> +	printf("%s", _SL_);
> +	printf("RX: Packets    Bytes        Errors CsumErrs OutOfSeq Mcasts%s", _SL_);
> +	printf("    %-10ld %-12ld %-6ld %-8ld %-8ld %-8ld%s",
> +	       rx_packets, rx_bytes, rx_errs, rx_frame, rx_fifo, rx_multi, _SL_);
> +	printf("TX: Packets    Bytes        Errors DeadLoop NoRoute  NoBufs%s", _SL_);
> +	printf("    %-10ld %-12ld %-6ld %-8ld %-8ld %-6ld",
> +	       tx_packets, tx_bytes, tx_errs, tx_colls, tx_carrier, tx_drops);
> +}

tunnel.c: In function ‘tnl_print_stats’:
tunnel.c:211:13: error: ‘buff’ undeclared (first use in this function)
   if (sscanf(buff, "%lu%lu%lu%lu%lu%lu%lu%*d%lu%lu%lu%lu%lu%lu%lu",
              ^
tunnel.c:211:13: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [tunnel.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ