[Swan-dev] new delta time type

D. Hugh Redelmeier hugh at mimosa.com
Sun Jan 25 23:31:21 EET 2015


| From: D. Hugh Redelmeier <hugh at mimosa.com>

| I think that the type of marg in complete_v1_state_transition is such
| an error:
| 
| 	time_t marg = deltamillisecs(
| 		c->sa_rekey_margin);

This probably caused the addition of the cast in:

	if (delay_ms > (unsigned long)(marg * 1000)) {

I hope that it can be removed.

The multiplication was added too.  I think that it is wrong: both
delay_ms and marg are in units of a millisecond.  I hope that the
typing that I have advocated would have caught this.

(I only discovered the calculation error because I was trying to
describe the type error.  It is way more reliable to have the type
system do this checking.)


More information about the Swan-dev mailing list