From owner-svn-src-stable-7@FreeBSD.ORG Fri Oct 30 13:03:09 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED971065670; Fri, 30 Oct 2009 13:03:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9088FC0C; Fri, 30 Oct 2009 13:03:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UD39Lm045196; Fri, 30 Oct 2009 13:03:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UD3880045194; Fri, 30 Oct 2009 13:03:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910301303.n9UD3880045194@svn.freebsd.org> From: Alexander Motin Date: Fri, 30 Oct 2009 13:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198675 - stable/7/lib/libradius X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2009 13:03:09 -0000 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;