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 > 0x7fffffff, 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_redirect_load << rt->u.dst.rate_tokens)) == false,
router will not send redirect packet. Here define b = rt-
>u.dst.rate_last +(ip_rt_redirect_load << rt->u.dst.rate_tokens):

1. If (jiffies - b <= 0x7fffffff), time_after(jiffies, b) == true,
router will send redirect packet.

2. If (jiffies - b > 0x7fffffff), time_after(jiffies, b) == false,
router will not send redirect packet. For example: when I add a router
after system boot, jiffies = (unsigned long)(-300000),
rt->u.dst.rate_last = 0, rt->u.dst.rate_tokens = 0, b = 20,
time_after((unsigned long)(-300000), 20) == false, send redirect packet
can not be send even if router is used in the first time.

When router send a  redirect packet in time b, and before jiffies
increased to 0x7fffffff + b, router can send redirect packet.
But if a redirect packet must be send in 0x80000000+ b,
time_after(jiffies, b) == false, redirect packet will not be send also.
So between time (0x80000000+ b) to time b, router do not send redirect
packet. That is to say, in a circle of jiffies, router has 24.9 days can
not send redirect packet (0x80000000/1000/60/60/24=24.9).

Wouldn't making ip_rt_redirect_load and other unsigned long instead of int fix the problem?

Remember time_after() works correctly for values that wraparound.

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 = (unsigned long)(-1) = a, this time a' is after b, but time_after(b, a') still equal to true,because values that wraparound can not be making in time_after().

Regards

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to