netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Yewang <lyw@nanjing-fnst.com>
To: herbert@gondor.apana.org.au
Cc: netdev@vger.kernel.org
Subject: Re:[PATCH]Fix BUG of ip_rt_send_redirect()
Date: Wed, 29 Nov 2006 16:51:31 +0800	[thread overview]
Message-ID: <1164790291.14696.5.camel@localhost.localdomain> (raw)

Herbert Xu <herbert@gondor.apana.org.au> wrote:

> 
> Since rate_last can also be zero if jiffies == 0 (OK that's
> extremely unlikely but I'm feeling picky today :), how about
> checking rate_tokens instead? The value of rate_last can only
> be relevant if rate_tokens is non-zero.
> 
> BTW, please also check the other spots where rate_last/rate_token
> is used.  They might need a similar fix.
> 
> Cheers,

Mr Herbert Xu

According to your advice, I have made another patch for the redirect
bug.

I have also checked other spots where rate_last/rate_tokens is used.
Those places need not be fixed.

Following is my patch:

signed-off-by: Li Yewang<lyw@nanjing-fnst.com>

--- linux-2.6.19.1/net/ipv4/route.c     2006-12-12 03:32:54.000000000
+0800
+++ linux-2.6.19.1/net/ipv4/route.org.c 2006-11-29 16:14:34.592058480
+0800
@@ -1327,7 +1327,8 @@ void ip_rt_send_redirect(struct sk_buff
        /* Check for load limit; set rate_last to the latest sent
         * redirect.
         */
-       if (time_after(jiffies,
+       if (rt->u.dst.rate_tokens == 0 ||
+            time_after(jiffies,
                       (rt->u.dst.rate_last +
                        (ip_rt_redirect_load << rt-
>u.dst.rate_tokens)))) {
                icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt-
>rt_gateway);




             reply	other threads:[~2006-12-18  5:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29  8:51 Li Yewang [this message]
2006-12-18  5:56 ` [PATCH]Fix BUG of ip_rt_send_redirect() Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2006-12-19  1:45 Li Yewang
2006-11-29  8:08 Li Yewang

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=1164790291.14696.5.camel@localhost.localdomain \
    --to=lyw@nanjing-fnst.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).