On Thu, Jul 12, 2018 at 1:57 AM David Laight [off-list ref] wrote:
From: Jon Maxwell Sent: 12 July 2018 01:36
...
quoted
- (s32)(tcp_time_stamp(tp) - start_ts) >
- jiffies_to_msecs(icsk->icsk_user_timeout))
+ (s32)(tcp_time_stamp(tp) - start_ts) > icsk->icsk_user_timeout)
That has never been tested properly.
icsk_user_timeout is u32 so the comparison is unsigned and the (s32) cast
has no effect.
The existing code had this ' bug' already.
Please do not blame this patch, and send a patch if you believe there
is an issue ?
In my opinion, the (s32) here is a reminder for the reader of the
width of the expression,
more than anything, since there is no chance the result can be negative.