Commit b999c474 authored by Robert Lubos's avatar Robert Lubos Committed by Christopher Friedt
Browse files

net: sockets: tls: Fix incorrectly used errno codes



ECONNABORTED was returned in case tls_mbedtls_reset() function for
resetting session failed, which can be caused by memory shortage. Return
ENOMEM instead.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 031ed185
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1876,7 +1876,7 @@ static ssize_t recvfrom_dtls_server(struct tls_context *ctx, void *buf,
				if (ret == 0) {
					repeat = true;
				} else {
					ret = -ECONNABORTED;
					ret = -ENOMEM;
				}

				continue;
@@ -1901,7 +1901,7 @@ static ssize_t recvfrom_dtls_server(struct tls_context *ctx, void *buf,
			if (ret == 0) {
				repeat = true;
			} else {
				ret = -ECONNABORTED;
				ret = -ENOMEM;
			}
			break;