tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: A strange TCP timestamp problem?



> I had a look around in the source code.
Thanks!

> There is a field in the TCP control structure called ts_timebase that gets 
> initialised to “tcp_now - 1”. tcp_now is the clock used the network stack 
> for tsval calculations and the fact that ts_timebase is initialised to 
> “tcp_now - 1” will be why the initial tsval is always 1. 
It's also initialized to sc_timebase in syn_cache_get().
sc_timebase is also initialized to tcp_now - 1 and never incremented?!

> I don’t know how the TCP stack handles tsval overflow/wrapping (or even if 
> that’s a thing), so maybe initialise ts_timebase to small random numbers?
So you mean replacing both instances of
	tcp_now - 1
by
	tcp_now - 1 + cpnrg_fast32() & 0xffff
or the like?

Would it be any harm to simply initialize to
	cpnrg_fast32()
(riscing that it could be 0 and confuse PenguinOS)?


Home | Main Index | Thread Index | Old Index