[PATCH]Fix BUG of ip_rt_send_redirect()

2006-11-16 Thread Li Yewang
[1]Summary of the problem: On IA32 system, If jiffies - b > 0x7fff, router can not send redirect packet.unsigned long b = rt->u.dst.rate_last +(ip_rt_redirect_load << rt->u.dst.rate_tokens) [2]Full description of the problem: In linux kernel, if time_after(jiffies, (rt->u.dst.rate_last +(ip_rt

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-11-16 Thread Stephen Hemminger
On Thu, 16 Nov 2006 23:57:50 -0500 Li Yewang <[EMAIL PROTECTED]> wrote: > [1]Summary of the problem: > On IA32 system, If jiffies - b > 0x7fff, router can not send > redirect packet.unsigned long b = rt->u.dst.rate_last > +(ip_rt_redirect_load << rt->u.dst.rate_tokens) > > [2]Full description

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-11-16 Thread Wei Yongjun
On Friday, November 17, 2006 11:51 AM Stephen Hemminger <[EMAIL PROTECTED]> wrote: On Thu, 16 Nov 2006 23:57:50 -0500 Li Yewang <[EMAIL PROTECTED]> wrote: [1]Summary of the problem: On IA32 system, If jiffies - b > 0x7fff, router can not send redirect packet.unsigned long b = rt->u.dst.rat

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-11-16 Thread Herbert Xu
Wei Yongjun <[EMAIL PROTECTED]> wrote: > > Yes, time_after() works correctly for values that wraparound. For examples: > if > time a = (unsigned long)(-1), and time b = 1; time_after(b, a) = true. > But if a is increaseing, after a circle of jiffies, a' = a + (unsigned > long)(-1) > + 1 = (uns

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-11-28 Thread Li Yewang
Herbert Xu [EMAIL PROTECTED] wrote: I think there are two problems here: 1) The first time we hit the check rate_last is zero. We should simply proceed with the redirect rather than treating this as a jiffies value. 2) When a dst is so old that the jiffies have wrapped around. I'm not sure w

Re:[PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-05 Thread Li Yewang
Herbert Xu <[EMAIL PROTECTED]> wrote: > >I think there are two problems here: > >1)The first time we hit the check rate_last is zero. We should simply >proceed with the redirect rather than treating this as a jiffies value. > >2)When a dst is so old that the jiffies have wrapped around. I'm >n

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-17 Thread Herbert Xu
On Wed, Nov 29, 2006 at 04:08:45PM +0800, Li Yewang wrote: > > --- linux-2.6.19/net/ipv4/route.c.org 2006-12-05 10:47:02.402147160 > +0800 > +++ linux-2.6.19/net/ipv4/route.c 2006-12-05 10:48:26.339386760 +0800 > @@ -1327,7 +1327,8 @@ void ip_rt_send_redirect(struct sk_buff > /* Check for load

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-17 Thread Herbert Xu
On Wed, Nov 29, 2006 at 04:51:31PM +0800, Li Yewang wrote: > > I have also checked other spots where rate_last/rate_tokens is used. > Those places need not be fixed. Thanks. > Following is my patch: > > signed-off-by: Li Yewang<[EMAIL PROTECTED]> Looks good to me. You should cc David Miller <

Re:[PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-17 Thread Li Yewang
Herbert Xu <[EMAIL PROTECTED]> 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 chec

Re:[PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-18 Thread Li Yewang
David Miller <[EMAIL PROTECTED]> wrote: > Applied, but I had to fix many errors in your patch by hand. > Please take care of these details next time. > > Here, your email client wrapped the lines in the patch, corrupting it. > > Please use real tab characters, when necessary, in the indentation

Re: [PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-18 Thread David Miller
From: Li Yewang <[EMAIL PROTECTED]> Date: Tue, 19 Dec 2006 09:45:25 +0800 > David Miller <[EMAIL PROTECTED]> wrote: > > > Applied, but I had to fix many errors in your patch by hand. > > Please take care of these details next time. > > > > Here, your email client wrapped the lines in the patch,