All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Mr Dash Four <mr.dash.four@googlemail.com>
Cc: Netfilter Core Team <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] nfacct: correct regressions in v1.0.1
Date: Tue, 5 Mar 2013 14:59:43 +0100	[thread overview]
Message-ID: <20130305135943.GA4369@localhost> (raw)
In-Reply-To: <5135E977.1000905@googlemail.com>

On Tue, Mar 05, 2013 at 12:47:51PM +0000, Mr Dash Four wrote:
> This patch fixes regressions present in v1.0.1, introduced as a result of
> commit d17c772c98057b2cc0118274605d292809ff6b1e.
> 
> Signed-off-by: Mr Dash Four <mr.dash.four@googlemail.com>
> ---
>  src/nfacct.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/nfacct.c b/src/nfacct.c
> index 4ce817d..21d4df8 100644
> --- a/src/nfacct.c
> +++ b/src/nfacct.c
> @@ -218,7 +218,8 @@ static int nfacct_cmd_list(int argc, char *argv[])
>  	return 0;
>  }
> 
> -static int _nfacct_cmd_add(char *name, int pkts, int bytes)
> +static int _nfacct_cmd_add(char *name,
> +			   long long unsigned pkts, long long unsigned bytes)

those are still signed, should be unsigned.

>  {
>  	struct mnl_socket *nl;
>  	char buf[MNL_SOCKET_BUFFER_SIZE];
> @@ -536,7 +537,7 @@ static int nfacct_cmd_restore(int argc, char *argv[])
>  			return -1;
>  		}
>  		*semicolon = 0;
> -		ret = sscanf(buffer, "{ pkts = %lu, bytes = %lu } = %s",
> +		ret = sscanf(buffer, "{ pkts = %llu, bytes = %llu } = %s",

Better use %"PRIu64" given that we're using uint64_t.

I have applied a patch based on yours.

Thanks.

  reply	other threads:[~2013-03-05 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 12:47 [PATCH] nfacct: correct regressions in v1.0.1 Mr Dash Four
2013-03-05 13:59 ` Pablo Neira Ayuso [this message]
2013-03-05 18:40   ` Mr Dash Four
2013-03-05 18:40   ` [PATCH] libnetfilter_acct: use PRIu64 and remove unnecessary cast Mr Dash Four
2013-03-15 11:47     ` Pablo Neira Ayuso
2013-03-16 14:06       ` Mr Dash Four

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130305135943.GA4369@localhost \
    --to=pablo@netfilter.org \
    --cc=mr.dash.four@googlemail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.