From patchwork Tue Sep 10 12:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3817 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6bd4:b0:5b9:581e:f939 with SMTP id c20csp2056636max; Tue, 10 Sep 2024 05:14:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUMGB57cx716kYeOQQBgxGcqaymwj2cm0Sx+VyG6YnLfoE9mv8ehKHFs+JPFt9a11HgFPmG7XgmXpw=@openvpn.net X-Google-Smtp-Source: AGHT+IF4E0VNZjQJTX1CyE/WgMw8hQt636SHPCEQyLkmJoDBXXPc0cnwqlrLmHSWNFgOutS+kDXZ X-Received: by 2002:a05:6602:29d3:b0:807:f0fb:1192 with SMTP id ca18e2360f4ac-82a9617a27amr1894727239f.1.1725970471803; Tue, 10 Sep 2024 05:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725970471; cv=none; d=google.com; s=arc-20240605; b=VdsSOIn0/fyKoGz+c6U1BpSOZYY6XfJJ4JbduEFAd1miZu5rpgxSajit6P74Ta5zWS GC6JLhGH9aA5qYery46IdAaIilwh5UV4+Ch+XNlMTuJ4VQ/Pe74a62lyHY91cwYb9qn8 Ui3GWuVfF93NaYYNP1marTq2i0KBcOHD0LzTR4uLa0+4yOc9GerT89mUgGnUCA/T0UNR VHCShfvy1GKlKjLosEimHMLfUBtD5SetNUJ3OAcoLrnKlU2zEHOX0JtG6xEZD+ZWaxtY z7nAqBbg6O/gP5tT9/MBY4QIB/Onxr+7RBmNXnbXFh+di/YNzWCPi0Xu8aQmlZMmGHmd 583w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=6xnqp8GRGwMkX2rq3XepyCNPuhGKJnKtZrwVbvvkfgE=; fh=GFP4qDxgyJ2WEPo/oeLZg3Mj4NqvY1j2nTvTt7psNwg=; b=fa+9r5HNbiy5tv+8LVJQiHaTp5JPdc5jlSTR5/yxZafAXG5+0X6GUf0H0hgTZfKhAI XxUOFkqRm0An1GbPJNMHsovEfJ8bmgTRu1kZo01zlKYeKGnx3naxG3Ah7q9HD2L1ebHv hPBMsmz49L7/BwP3LZMeeuyS9gOlA5wlpvKMUiZ/f7+lgfSuD5/ZtfWY9iWEfLO/kldM UljKY1HaaPyLSGcJpNqWfvSrei3m9RoBHastZ7qqZ5JIxLHbGWpJ71RU/RzehfU06xiW Mp9uHigtksRrTeZNhXVG2zxKxWWyuoXC17Jihqw61XeQYXtC4FZ6SPma8NqELlZlqcFg kkaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=DFFbLFkK; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=MVdxxmZC; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=ZQLoc1qv; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id ca18e2360f4ac-82aa733cd57si323179239f.12.2024.09.10.05.14.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2024 05:14:31 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=DFFbLFkK; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=MVdxxmZC; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=ZQLoc1qv; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1snzlM-0003Fo-9F; Tue, 10 Sep 2024 12:14:29 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1snzlK-0003Fg-E6 for openvpn-devel@lists.sourceforge.net; Tue, 10 Sep 2024 12:14:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=awytzVwrOO+l5+vhtZ2hphDvp3ovvcXG53DhPeaCHAo=; b=DFFbLFkKi3+C1xVLmOU5diLW+A YN5UHeng9RrugHX5v1+InelnLzFjllI99Gf2r5Mu3+gZkQjlPTE5Ytg4n6jBpT0sW0cL1R22PFS/k SWORvA+3wmT8G6+XhCGmqmkO/vQ8P7dtRvdl4zhBgZzMH7BkOR73Pxez1atNCQpR31og=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=awytzVwrOO+l5+vhtZ2hphDvp3ovvcXG53DhPeaCHAo=; b=M VdxxmZCvkEVeXymMaSg4YInhAzRqu4O0vDbujcVFaQT4Aps82owe2wo5Aq2z7p+yUEW3ByeOQyAuc sqBfcXQ6WSTT5Ngt1scIFbZtsaLQARfsKVuIhBOUFv1ujOGl/JJ0TYMJsqN0iZPOkeaE8DcQTidtv JYofaqUGpGQV3hrw=; Received: from mail-wm1-f45.google.com ([209.85.128.45]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1snzlK-0003Nq-4N for openvpn-devel@lists.sourceforge.net; Tue, 10 Sep 2024 12:14:27 +0000 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42ca6ba750eso23078355e9.0 for ; Tue, 10 Sep 2024 05:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1725970459; x=1726575259; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=awytzVwrOO+l5+vhtZ2hphDvp3ovvcXG53DhPeaCHAo=; b=ZQLoc1qvktCUye4FEBXxbhjlIZGLIb8wzPKzvsx3Kl37SlU059ro1fvHtdPTpJVl9i nsAQDjMWdHnTAex2ECRLV1b1Qjg6q+8wgpkxMZAc7bQlw0Mpbx6s40HXwxLxrECnrDR2 IOxr4c5dB/qVRjKvtu6Krbj5bFzsE54YrmfhdxbRDiCXShTBkRCHwAeaMM8duNkDi0gd vbgCr8LsC4uxqjasoJZ2PV9BBxVkSYGAvZPq1ZwzkVJjQsan9C9uyYgk5dr26Y9prHSt uHsBKBf6t7z2CyfkdxenSfwnDcF1oVaRqepwTB8ZI8nvrp+r0a+zuonc+j7yXAcf3bnA LM5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725970459; x=1726575259; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=awytzVwrOO+l5+vhtZ2hphDvp3ovvcXG53DhPeaCHAo=; b=XWbx+3irf2FzKP8c19HBFTndoa5ESJy/sBl/eWxnnFHt3XBIyaHzpUOGkfjwV7leSp UQxPo0JnUBkRxQyJfeBiYU1kCLJ6PwSQ/1z6/o1GdD0e+MLiLpK7zA09wejz65nwur1/ fPjnoDgZEoHKrFlZjsrVxi+7gcRntgzeOnE6L9oykytcAag4VknKKT4lQVBxSnqkN+5q KhVVLAM5xnQUvpMBIP0+LwE0vQ9mi4zJxrc+v1YYropP0t85wuLacnsa9nqgcheeuqTj owJ8C4TtMbHSssdRA3fR/TYq+hpoUuCbmifvwK8eyXFeIAQyr+w2Z5Y92doqSHeZJPWC Tvdw== X-Gm-Message-State: AOJu0Yzp9bqtr57kG2MhAh8I7n4VjcIKTRFMCVIwrXBMNC0XRFXoeWCu Z0j5Tr7T5gujD7DSh2tml00C0s+DdOlLg3GTrSq/0cEqMzB+JwjvhjNTOP14PIj9OdfppzTf5hN 2 X-Received: by 2002:a05:600c:310e:b0:42c:b68f:38fb with SMTP id 5b1f17b1804b1-42cbddd6d0amr17602705e9.7.1725970459361; Tue, 10 Sep 2024 05:14:19 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca05c6340sm146365845e9.4.2024.09.10.05.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 05:14:19 -0700 (PDT) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 10 Sep 2024 12:14:18 +0000 To: plaisthos Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I7852c06d331326c1dbab7b642254c0c00d4cebb8 X-Gerrit-Change-Number: 740 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 8c3b7f41f735275585937698bee28205607f7610 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.45 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.45 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1snzlK-0003Nq-4N Subject: [Openvpn-devel] [S] Change in openvpn[master]: socket: Change return types of link_socket_write* to ssize_t X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: frank@lichtenheld.com, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1809811213088047275?= X-GMAIL-MSGID: =?utf-8?q?1809811213088047275?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/740?usp=email to review the following change. Change subject: socket: Change return types of link_socket_write* to ssize_t ...................................................................... socket: Change return types of link_socket_write* to ssize_t This is the actual return value of send/sendto/sendmsg. We will leave it to the single caller of link_socket_write() to decide how to map that to the int buffer world. For now just cast it explicitly. Change-Id: I7852c06d331326c1dbab7b642254c0c00d4cebb8 Signed-off-by: Frank Lichtenheld --- M src/openvpn/forward.c M src/openvpn/socket.c M src/openvpn/socket.h 3 files changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/40/740/1 diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 40b7cc4..84c23b3 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -1790,7 +1790,7 @@ socks_preprocess_outgoing_link(c, &to_addr, &size_delta); /* Send packet */ - size = link_socket_write(c->c2.link_socket, &c->c2.to_link, to_addr); + size = (int)link_socket_write(c->c2.link_socket, &c->c2.to_link, to_addr); /* Undo effect of prepend */ link_socket_write_post_size_adjust(&size, size_delta, &c->c2.to_link); diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 17c5e76..6c790a0 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -3399,7 +3399,7 @@ * Socket Write Routines */ -int +ssize_t link_socket_write_tcp(struct link_socket *sock, struct buffer *buf, struct link_socket_actual *to) @@ -3418,7 +3418,7 @@ #if ENABLE_IP_PKTINFO -size_t +ssize_t link_socket_write_udp_posix_sendmsg(struct link_socket *sock, struct buffer *buf, struct link_socket_actual *to) diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h index 47083ad..bbdabfb 100644 --- a/src/openvpn/socket.h +++ b/src/openvpn/socket.h @@ -1099,9 +1099,9 @@ * Socket Write routines */ -int link_socket_write_tcp(struct link_socket *sock, - struct buffer *buf, - struct link_socket_actual *to); +ssize_t link_socket_write_tcp(struct link_socket *sock, + struct buffer *buf, + struct link_socket_actual *to); #ifdef _WIN32 @@ -1135,12 +1135,12 @@ #else /* ifdef _WIN32 */ -size_t link_socket_write_udp_posix_sendmsg(struct link_socket *sock, - struct buffer *buf, - struct link_socket_actual *to); +ssize_t link_socket_write_udp_posix_sendmsg(struct link_socket *sock, + struct buffer *buf, + struct link_socket_actual *to); -static inline size_t +static inline ssize_t link_socket_write_udp_posix(struct link_socket *sock, struct buffer *buf, struct link_socket_actual *to) @@ -1158,7 +1158,7 @@ (socklen_t) af_addr_size(to->dest.addr.sa.sa_family)); } -static inline size_t +static inline ssize_t link_socket_write_tcp_posix(struct link_socket *sock, struct buffer *buf, struct link_socket_actual *to) @@ -1168,7 +1168,7 @@ #endif /* ifdef _WIN32 */ -static inline size_t +static inline ssize_t link_socket_write_udp(struct link_socket *sock, struct buffer *buf, struct link_socket_actual *to) @@ -1181,7 +1181,7 @@ } /* write a TCP or UDP packet to link */ -static inline int +static inline ssize_t link_socket_write(struct link_socket *sock, struct buffer *buf, struct link_socket_actual *to)