aboutsummaryrefslogtreecommitdiff
path: root/lib/libradius
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2009-09-29 19:09:17 +0000
committerAlexander Motin <mav@FreeBSD.org>2009-09-29 19:09:17 +0000
commit21fc30e1a3fc8128979c8fd746ed3488a21d4cd4 (patch)
tree8751a5ccadb6447cdc78dfa99e3eb97b6f17b1f0 /lib/libradius
parente52df452d188493dc49600796cec7b6eaff7c1e1 (diff)
downloadsrc-21fc30e1a3fc8128979c8fd746ed3488a21d4cd4.tar.gz
src-21fc30e1a3fc8128979c8fd746ed3488a21d4cd4.zip
Fix bug, when RADIUS client gave up after single sendto() error, do not
trying backup servers. PR: kern/103764, misc/139214
Notes
Notes: svn path=/head/; revision=197621
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 8faaf7e12a60..e4e4a9411800 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;