From nobody Sun Jan 30 17:55:09 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5638B198E89F; Sun, 30 Jan 2022 17:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JmzPB0b5vz3tDt; Sun, 30 Jan 2022 17:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643565310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mfX+fwBJelfR+GEe/xN2nahbaGqrYy5kaVQZ72Sf21s=; b=XqxUQDGtsujfIQELSngL12g9WsnazeE78pElFkNIAtjQeD8N09Es8OZDRm1CobJFKaysUG Tl1Ip7n4Pf2vvKarByPHUwaMYhyL1/8lOdeEmfzQ0VcZonPKw9BMNQph9jfTB5vQHiV/H7 Y0t+wWacTVi4c7SuHCNNRsu7luFNccOc9UiG/iuo1ccRzeIH+v4Xchu3vai17X1dmO1GYx yB1fsEt3uCslmFnGSqeTRnayd5dMq6rtQrH7AnDoU388MXaN2DW2TNRqD6B+eaAcZWqVt4 3Qkj782ZGMZAd+asys3kYhN1yea+y3A+rrOK17Foj9XRG8mFhPoF6U9XobMNWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C97E65706; Sun, 30 Jan 2022 17:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20UHt9pZ001867; Sun, 30 Jan 2022 17:55:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20UHt9sP001866; Sun, 30 Jan 2022 17:55:09 GMT (envelope-from git) Date: Sun, 30 Jan 2022 17:55:09 GMT Message-Id: <202201301755.20UHt9sP001866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 73df35607d08 - stable/13 - dma: update to 2022-01-27 snapshot List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 73df35607d0894d82bdedce196edd6a809ad182f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643565310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mfX+fwBJelfR+GEe/xN2nahbaGqrYy5kaVQZ72Sf21s=; b=ODKtyP9rR2VpCaRN/sfSWbUoUGIyC/sCQEGjjGcfupwj7w44JaOKpdHCfyME3YZt3GCT/h db52VN00HqXYxFdEEX1Y13Z/TvjQld6MIxSmQnW11xpwpeTTiNvtaizJhlRXgCJvUiuRy5 OE8rFv++x+icszjq1Z1vsps6ff8dawO92bvnUB9vIxpQWnWWEKsyit1nidyGfhKJJRThYi +MS3tapUGrU9xJnNBsjZq7Kob9Ja5ETrIODTc2HmG85CrkXm1KIqSI7qi5yuVWsX3yFsi1 YpW8LSyS3SMu3JdxhJcWBmRF3XqgjRRJ2A+HATQ0NgKy1Ila6xQOQ0NY2e9cjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643565310; a=rsa-sha256; cv=none; b=HY6V6CPZC9Y9QXgeyrPbCmTpHutqr/OvKycwB+kJFfIFZsdo7HwJJL+nfoKtg4OBKEhF2e SxOJp+GUNbsxGw96JI4VYI9fYFECcH7cBjQBUHXai1oNiSabpaos9mAWheFA3n7GtGhFb4 PFhpPcH2+2FpNoKo5Z9i9LiBBMRXt1pkgI2jdWRTDzzvcLfD/i6ORkYgYuGSYI5XpPrIMf 6/2mHTzuEcLOBYLxUxLEhwX5JJJhshbqXOECDRbVMJx+MlbKC3PdhgDdO1mrNo32X2naiC PPrFsyslqGagHxRQ7FDEhIyJZGgDWS9VCiZ/0lMIBXFJG2t/2jDXRM3EPRme9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=73df35607d0894d82bdedce196edd6a809ad182f commit 73df35607d0894d82bdedce196edd6a809ad182f Author: Ed Maste AuthorDate: 2022-01-27 19:30:58 +0000 Commit: Ed Maste CommitDate: 2022-01-30 17:54:56 +0000 dma: update to 2022-01-27 snapshot (cherry picked from commit d045091ea25c916412474b4f7a9423c5d35b231f) --- contrib/dma/net.c | 51 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/contrib/dma/net.c b/contrib/dma/net.c index e8e2634a9386..0079875a22e0 100644 --- a/contrib/dma/net.c +++ b/contrib/dma/net.c @@ -95,25 +95,29 @@ send_remote_command(int fd, const char* fmt, ...) strcat(cmd, "\r\n"); len = strlen(cmd); - if (((config.features & SECURETRANSFER) != 0) && - ((config.features & NOSSL) == 0)) { - while ((s = SSL_write(config.ssl, (const char*)cmd, len)) <= 0) { - s = SSL_get_error(config.ssl, s); - if (s != SSL_ERROR_WANT_READ && - s != SSL_ERROR_WANT_WRITE) { - strlcpy(neterr, ssl_errstr(), sizeof(neterr)); - return (-1); + pos = 0; + while (pos < len) { + if (((config.features & SECURETRANSFER) != 0) && + ((config.features & NOSSL) == 0)) { + if ((n = SSL_write(config.ssl, (const char*)(cmd + pos), len - pos)) <= 0) { + s = SSL_get_error(config.ssl, n); + if (s == SSL_ERROR_ZERO_RETURN || + s == SSL_ERROR_SYSCALL || + s == SSL_ERROR_SSL) { + strlcpy(neterr, ssl_errstr(), sizeof(neterr)); + return (-1); + } + n = 0; } - } - } - else { - pos = 0; - while (pos < len) { + } else { n = write(fd, cmd + pos, len - pos); - if (n < 0) - return (-1); - pos += n; + if (n < 0) { + if ((errno != EAGAIN) && (errno != EINTR)) + return (-1); + n = 0; + } } + pos += n; } return (len); @@ -150,9 +154,18 @@ read_remote(int fd, int extbufsize, char *extbuf) pos = 0; if (((config.features & SECURETRANSFER) != 0) && (config.features & NOSSL) == 0) { - if ((rlen = SSL_read(config.ssl, buff + len, sizeof(buff) - len)) == -1) { - strlcpy(neterr, ssl_errstr(), sizeof(neterr)); - goto error; + if ((rlen = SSL_read(config.ssl, buff + len, sizeof(buff) - len)) <= 0) { + switch (SSL_get_error(config.ssl, rlen)) { + case SSL_ERROR_ZERO_RETURN: + case SSL_ERROR_SYSCALL: + case SSL_ERROR_SSL: + strlcpy(neterr, ssl_errstr(), sizeof(neterr)); + goto error; + default: + /* in case of recoverable error, retry after short sleep */ + usleep(10000); + continue; + } } } else { if ((rlen = read(fd, buff + len, sizeof(buff) - len)) == -1) {