summaryrefslogtreecommitdiffstats
path: root/lib/libradius
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2009-09-29 19:09:17 +0000
committermav <mav@FreeBSD.org>2009-09-29 19:09:17 +0000
commitef8505938aea0f883ebbebe52fd33eb26881b4d8 (patch)
tree8751a5ccadb6447cdc78dfa99e3eb97b6f17b1f0 /lib/libradius
parentf5d17346cca8813ec8958144c08e88d72d0e098b (diff)
downloadFreeBSD-src-ef8505938aea0f883ebbebe52fd33eb26881b4d8.zip
FreeBSD-src-ef8505938aea0f883ebbebe52fd33eb26881b4d8.tar.gz
Fix bug, when RADIUS client gave up after single sendto() error, do not
trying backup servers. PR: kern/103764, misc/139214
Diffstat (limited to 'lib/libradius')
-rw-r--r--lib/libradius/radlib.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c
index 8faaf7e..e4e4a94 100644
--- a/lib/libradius/radlib.c
+++ b/lib/libradius/radlib.c
@@ -650,17 +650,12 @@ rad_continue_send_request(struct rad_handle *h, int selected, int *fd,
n = sendto(h->fd, h->out, h->out_len, 0,
(const struct sockaddr *)&h->servers[h->srv].addr,
sizeof h->servers[h->srv].addr);
- if (n != h->out_len) {
- if (n == -1)
- generr(h, "sendto: %s", strerror(errno));
- else
- generr(h, "sendto: short write");
- return -1;
- }
-
+ if (n != h->out_len)
+ tv->tv_sec = 1; /* Do not wait full timeout if send failed. */
+ else
+ tv->tv_sec = h->servers[h->srv].timeout;
h->try++;
h->servers[h->srv].num_tries++;
- tv->tv_sec = h->servers[h->srv].timeout;
tv->tv_usec = 0;
*fd = h->fd;
OpenPOWER on IntegriCloud