This commit fixes various aspects in the UDP client timeout handling.
Timeouts are now applied in a more consistent fashion. Discarded UDP
packets no longer prevent the timeout from happening at all.
2017-02-09 Florian Weimer <fweimer@redhat.com>
[BZ #20257]
* inet/Makefile (routines): Add deadline.
(tests-static): Add tst-deadline.
* inet/net-internal.h (struct deadline_current_time)
(__deadline_current_time, struct deadline, __deadline_is_infinite)
(__deadline_elapsed, __deadline_first, __deadline_from_timeval)
(__deadline_to_ms, __is_timeval_valid_timeout): Declare.
* inet/deadline.c: New file.
* inet/tst-deadline.c: Likewise.
* sunrpc/Makefile (tests): Add tst-udp-timeout, tst-udp-garbage.
(tst-udp-timeout): Link against libc.so explicitly.
(tst-udp-garbage): Likewise. Also link against thread library.
* sunrpc/clnt_udp.c (clntudp_call): Rework timeout handling.
* sunrpc/tst-udp-garbage.c: New file.
* sunrpc/tst-udp-timeout.c: Likewise.