Prevent from grace period overflow in RPC transport
The RPC transports grace time as unsigned int, but the value stored
there and retrivedd from is treated as singed difference against current time.
This leads to overflow after expiring the grace time which is
presented as an enourmously large grace time instead of "none" in the
There also possible an overflow when the time difference is still
bigger than an int can represent.
This first issue is solved by explicit type cast to/from int32_t, the
second issue is fixes by limiting the value into int32_t range.
Signed-off-by: Petr Písař <email@example.com>
Signed-off-by: Jan Kara <firstname.lastname@example.org>