[En-Nut-Discussion] Latest fix in tcpsm.c and tcpout.c

Ole Reinhardt ole.reinhardt at embedded-it.de
Thu Apr 10 14:47:46 CEST 2008


Hi all,

just thinking again about the lastest fix in the tcp retransmission
code.

The main problem was that the retransmission timer overflows after
approximatly 65 seconds. This was mainly caused by the size of the
variable holding the packet send time. It's an unsigned short. 

The quick fix was to always set the lowest bit. I'm not shure if this
might not lead to new errors as this could also lead to a value in the
future (if the lowest bit ist not yet set.). Ok, perhaps this fix does
not cause any problems at all. At least I did not read the whole code.

But I'd like to suggest to use larger variables for the retransmission
time. Why not use u_long instead of u_short? Ok, on AVR it might cost a
little more time to calculate, but for simple additions and
substractions 32bit calculations are not that expensive and using larger
variables would be much cleaner code in my eyes.

What's your opinion?

Regards,

Ole Reinhardt

-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list