All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Jean <sj-netfilter@cookinglinux.org>
To: Harald Welte <laforge@netfilter.org>
Cc: netfilter-devel@lists.netfilter.org
Subject: [PATCH 1/2] ipt_hashlimit.c: expire's type overflow when showing tuples at bad moment.
Date: Wed, 26 Jan 2005 22:51:43 -0500	[thread overview]
Message-ID: <41F8654F.2020607@cookinglinux.org> (raw)

Name: Expire's type overflow when showing tuples at bad moment.
Status: Tested under Linux 2.6.10
Signed-off-by: Samuel Jean <sjean@cookinglinux.org>

When garbage collector runs slow enough, we have a chance to print
expired tuples before they get freed. We see weird expiry time.

This patch just prints 0 if expiry is less than or equal to current
jiffie.

Please disregard my previous patch.

--- net/ipv4/netfilter/ipt_hashlimit.c.orig  2005-01-26 22:17:54.000000000 -0500
+++ net/ipv4/netfilter/ipt_hashlimit.c 2005-01-26 22:22:07.000000000 -0500
@@ -608,8 +608,8 @@ static inline int dl_seq_real_show(struc
    /* recalculate to show accurate numbers */
    rateinfo_recalc(ent, jiffies);

-  return seq_printf(s, "%ld %u.%u.%u.%u:%u->%u.%u.%u.%u:%u %u %u %u\n",
-        (ent->expires - jiffies)/HZ,
+  return seq_printf(s, "%lu %u.%u.%u.%u:%u->%u.%u.%u.%u:%u %u %u %u\n",
+        (ent->expires > jiffies) ? (ent->expires - jiffies)/HZ : 0,
          NIPQUAD(ent->dst.src_ip), ntohs(ent->dst.src_port),
          NIPQUAD(ent->dst.dst_ip), ntohs(ent->dst.dst_port),
          ent->rateinfo.credit, ent->rateinfo.credit_cap,

                 reply	other threads:[~2005-01-27  3:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41F8654F.2020607@cookinglinux.org \
    --to=sj-netfilter@cookinglinux.org \
    --cc=laforge@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.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.