Thread (1 message) 1 message, 1 author, 2018-07-12

Re: [net-next, 1/3] tcp: convert icsk_user_timeout from jiffies to msecs

From: Eric Dumazet <edumazet@google.com>
Date: 2018-07-12 12:36:11
Also in: lkml

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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help