From patchwork Sat Jan 1 05:25:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2199 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.27.255.58]) by backend41.mail.ord1d.rsapps.net with LMTP id +CW6MbmA0GFtLAAAqwncew (envelope-from ) for ; Sat, 01 Jan 2022 11:26:33 -0500 Received: from proxy2.mail.iad3a.rsapps.net ([172.27.255.58]) by director7.mail.ord1d.rsapps.net with LMTP id uCJQNLmA0GHtQQAAovjBpQ (envelope-from ) for ; Sat, 01 Jan 2022 11:26:33 -0500 Received: from smtp7.gate.iad3a ([172.27.255.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.iad3a.rsapps.net with LMTPS id sAQkLLmA0GFUVgAABcWvHw (envelope-from ) for ; Sat, 01 Jan 2022 11:26:33 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp7.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 94cc4194-6b1f-11ec-8c60-525400bbebb8-1-1 Received: from [216.105.38.7] ([216.105.38.7:48036] helo=lists.sourceforge.net) by smtp7.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E2/C1-29000-9B080D16; Sat, 01 Jan 2022 11:26:33 -0500 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.94.2) (envelope-from ) id 1n3hCU-0000eU-Fx; Sat, 01 Jan 2022 16:25:47 +0000 Received: from [172.30.20.202] (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.94.2) (envelope-from ) id 1n3hCS-0000e5-L0 for openvpn-devel@lists.sourceforge.net; Sat, 01 Jan 2022 16:25:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2fUHxDPvSxKUsydirgsjPPRU67cVR00qnCJeLIYebwc=; b=PhSmtLYINYP3ei+pt2+BTM6Wse X9+7y/4WX5QCqmvWpiVqqx3m11I3kwQ8ST1JCAbbZOiHQLrICZVbpU4UbWWR9kIbTEAXZIQ9Ev262 eftk7atDUeRijzndsh6UaI7qBDyf5wsxdXcz8LuT6JdfdIM9rLQcTaCXGOuLRwGLLOTw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2fUHxDPvSxKUsydirgsjPPRU67cVR00qnCJeLIYebwc=; b=NYTPij83YtllViIk9pE01TQGSz pv4SZTDLMNbvo+YGV88+GvYLggmR5CvNIa32y6pv5N9sABpgUVaE+DWeLPYTNwOhO2xjF6EuvR6fM oTAOAULhACqO7UARu/qBJTUKBPzKkWXYzWlzMgATHasTKv53JZ2mHkiRegS/J+c2h+Lk=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1n3hCT-00GV3z-5A for openvpn-devel@lists.sourceforge.net; Sat, 01 Jan 2022 16:25:45 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94.2 (FreeBSD)) (envelope-from ) id 1n3hCH-000FgP-Jo for openvpn-devel@lists.sourceforge.net; Sat, 01 Jan 2022 17:25:33 +0100 Received: (nullmailer pid 2251907 invoked by uid 10006); Sat, 01 Jan 2022 16:25:33 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Sat, 1 Jan 2022 17:25:29 +0100 Message-Id: <20220101162532.2251835-12-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220101162532.2251835-1-arne@rfc2549.org> References: <20220101162532.2251835-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: The previous commits removed any reads from this variable. So we can now safely remove it. Signed-off-by: Arne Schwabe --- src/openvpn/init.c | 19 src/openvpn/mtu.c | 1 - src/openvpn/mtu.h | 13 src/openvpn/socks.c | 11 + src/ope [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1n3hCT-00GV3z-5A Subject: [Openvpn-devel] [PATCH v3 11/14] Remove extra_link from frame 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The previous commits removed any reads from this variable. So we can now safely remove it. Signed-off-by: Arne Schwabe --- src/openvpn/init.c | 19 ------------------- src/openvpn/mtu.c | 1 - src/openvpn/mtu.h | 13 ------------- src/openvpn/socks.c | 11 +---------- src/openvpn/socks.h | 2 -- src/openvpn/ssl.c | 1 - 6 files changed, 1 insertion(+), 46 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index dfc44e9d..bf6369f8 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -3171,14 +3171,6 @@ do_init_frame(struct context *c) } #endif /* USE_COMP */ - /* - * Adjust frame size for UDP Socks support. - */ - if (c->options.ce.socks_proxy_server) - { - socks_adjust_frame_parameters(&c->c2.frame, c->options.ce.proto); - } - /* * Adjust frame size based on the --tun-mtu-extra parameter. */ @@ -3211,17 +3203,6 @@ do_init_frame(struct context *c) #endif #endif /* USE_COMP */ - /* packets with peer-id (P_DATA_V2) need 3 extra bytes in frame (on client) - * and need link_mtu+3 bytes on socket reception (on server). - * - * accommodate receive path in f->extra_link, which has the side effect of - * also increasing send buffers (BUF_SIZE() macro), which need to be - * allocated big enough before receiving peer-id option from server. - * - * f->extra_frame is adjusted when peer-id option is push-received - */ - frame_add_to_extra_link(&c->c2.frame, 3); - #ifdef ENABLE_FRAGMENT /* * Set frame parameter for fragment code. This is necessary because diff --git a/src/openvpn/mtu.c b/src/openvpn/mtu.c index ab088466..0bcfbfd1 100644 --- a/src/openvpn/mtu.c +++ b/src/openvpn/mtu.c @@ -266,7 +266,6 @@ frame_print(const struct frame *frame, buf_printf(&out, " EF:%d", frame->extra_frame); buf_printf(&out, " EB:%d", frame->extra_buffer); buf_printf(&out, " ET:%d", frame->extra_tun); - buf_printf(&out, " EL:%d", frame->extra_link); buf_printf(&out, " ]"); msg(level, "%s", out.data); diff --git a/src/openvpn/mtu.h b/src/openvpn/mtu.h index 288cfad6..a87adbc4 100644 --- a/src/openvpn/mtu.h +++ b/src/openvpn/mtu.h @@ -163,13 +163,6 @@ struct frame { * which defaults to 0 for tun and 32 * (\c TAP_MTU_EXTRA_DEFAULT) for tap. * */ - - int extra_link; /**< Maximum number of bytes in excess of - * external network interface's MTU that - * might be read from or written to it. - * - * Used by peer-id (3) and - * socks UDP (10) */ }; /* Forward declarations, to prevent includes */ @@ -383,12 +376,6 @@ frame_add_to_extra_tun(struct frame *frame, const int increment) frame->extra_tun += increment; } -static inline void -frame_add_to_extra_link(struct frame *frame, const int increment) -{ - frame->extra_link += increment; -} - static inline void frame_add_to_extra_buffer(struct frame *frame, const int increment) { diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c index 27a58331..6935e761 100644 --- a/src/openvpn/socks.c +++ b/src/openvpn/socks.c @@ -49,15 +49,6 @@ #define UP_TYPE_SOCKS "SOCKS Proxy" -void -socks_adjust_frame_parameters(struct frame *frame, int proto) -{ - if (proto == PROTO_UDP) - { - frame_add_to_extra_link(frame, 10); - } -} - struct socks_proxy_info * socks_proxy_new(const char *server, const char *port, @@ -610,7 +601,7 @@ socks_process_outgoing_udp(struct buffer *buf, /* * Get a 10 byte subset buffer prepended to buf -- * we expect these bytes will be here because - * we allocated frame space in socks_adjust_frame_parameters. + * we always allocate space for these bytes */ struct buffer head = buf_sub(buf, 10, true); diff --git a/src/openvpn/socks.h b/src/openvpn/socks.h index 9bda2e80..4ab30f55 100644 --- a/src/openvpn/socks.h +++ b/src/openvpn/socks.h @@ -42,8 +42,6 @@ struct socks_proxy_info { char authfile[256]; }; -void socks_adjust_frame_parameters(struct frame *frame, int proto); - struct socks_proxy_info *socks_proxy_new(const char *server, const char *port, const char *authfile); diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 78983545..091f40eb 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -322,7 +322,6 @@ tls_init_control_channel_frame_parameters(const struct frame *data_channel_frame /* inherit link MTU and extra_link from data channel */ frame->link_mtu = data_channel_frame->link_mtu; - frame->extra_link = data_channel_frame->extra_link; /* set extra_frame */ tls_adjust_frame_parameters(frame);