Re: [PATCH V2] ipv6: fix incorrect route 'expires' value passed to userspace
From: Li Wei <hidden>
Date: 2012-07-20 01:33:14
于 2012-7-20 1:49, David Miller 写道:
From: Li Wei <redacted> Date: Thu, 19 Jul 2012 10:02:59 +0800quoted
When userspace use RTM_GETROUTE to dump route table, with an already expired route entry, we always got an 'expires' value(2147157) calculated base on INT_MAX. The reason of this problem is in the following satement: rt->dst.expires - jiffies < INT_MAX gcc promoted the type of both sides of '<' to unsigned long, thus a small negative value would be considered greater than INT_MAX. This patch fix this by use the same trick as time_after macro to avoid the 'unsigned long' type promotion and deal with jiffies wrapping. Also we should do some fix in rtnl_put_cacheinfo() which use jiffies_to_clock_t(which take an unsigned long as parameter) to convert jiffies to clock_t to handle the negative expires. Signed-off-by: Li Wei <redacted>Your patch is corrupted by your email client and therefore will not apply cleanly. I think this isn't the first time your patch submissions have had this problem, and if so then you should do the necessary work to prevent problem with more certainty in the future as such this makes a lot of extra work for other people.
Really sorry for that, I'll resend this patch and before that sending myself a copy to confirm the mail client works properly. Thanks