All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Samuel Jean <sj-netfilter@cookinglinux.org>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] ipt_hashlimit.c: expire's type overflow when showing tuples at bad moment.
Date: Tue, 01 Feb 2005 19:16:16 +0100	[thread overview]
Message-ID: <41FFC770.2090401@trash.net> (raw)
In-Reply-To: <6732.142.169.215.10.1107269629.squirrel@142.169.215.10>

Samuel Jean wrote:

>On Tue, February 1, 2005 9:20 am, Patrick McHardy said:
>  
>
>>ipt_hashlimit already uses %ld. Samuel, what problem are you seeing
>>exactly ?
>>Is it negative times or wrapped times ?
>>    
>>
>
>I see wrapped time.
>
>I've tried making it print negative values, but seems I can't get
>unsigned operations to result in a signed value. Is that right ?
>
No. On my system va_arg (used by vsnprintf, used by seq_sprintf)
behaves strangely. From vsnprintf:

                else if (qualifier == 'l') {
                        num = va_arg(args, unsigned long);
                        if (flags & SIGN)
                                num = (signed long) num;

On my system (x86_64, gcc-3.3.5) va_arg returns 2^32-1 for -1, but it
should return 2^64-1. Are you seeing this problem on a 32bit or a 64bit
machine ?

Regards
Patrick

  reply	other threads:[~2005-02-01 18:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-23  1:32 [PATCH] ipt_hashlimit.c: expire's type overflow when showing tuples at bad moment Samuel Jean
2005-02-01 13:29 ` Harald Welte
2005-02-01 13:43   ` Patrick McHardy
2005-02-01 13:54     ` Harald Welte
2005-02-01 14:20       ` Patrick McHardy
2005-02-01 14:53         ` Samuel Jean
2005-02-01 18:16           ` Patrick McHardy [this message]
2005-02-01 21:47             ` Samuel Jean
2005-02-02  2:11               ` Patrick McHardy

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=41FFC770.2090401@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=sj-netfilter@cookinglinux.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.