Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Oct 2009 13:03:08 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r198675 - stable/7/lib/libradius
Message-ID:  <200910301303.n9UD3880045194@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Oct 30 13:03:08 2009
New Revision: 198675
URL: http://svn.freebsd.org/changeset/base/198675

Log:
  MFC rev. 197621:
  Fix bug, when RADIUS client gave up after single sendto() error, do not
  trying backup servers.
  
  PR:             kern/103764, misc/139214

Modified:
  stable/7/lib/libradius/   (props changed)
  stable/7/lib/libradius/radlib.c

Modified: stable/7/lib/libradius/radlib.c
==============================================================================
--- stable/7/lib/libradius/radlib.c	Fri Oct 30 13:02:08 2009	(r198674)
+++ stable/7/lib/libradius/radlib.c	Fri Oct 30 13:03:08 2009	(r198675)
@@ -650,17 +650,12 @@ rad_continue_send_request(struct rad_han
 	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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910301303.n9UD3880045194>