From patchwork Tue Dec 7 06:02:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2138 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.31.255.6]) by backend41.mail.ord1d.rsapps.net with LMTP id CM0/O9STr2FAUwAAqwncew (envelope-from ) for ; Tue, 07 Dec 2021 12:03:16 -0500 Received: from proxy18.mail.iad3b.rsapps.net ([172.31.255.6]) by director14.mail.ord1d.rsapps.net with LMTP id OJDtHNWTr2EWaQAAeJ7fFg (envelope-from ) for ; Tue, 07 Dec 2021 12:03:17 -0500 Received: from smtp27.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy18.mail.iad3b.rsapps.net with LMTPS id GAL4FdWTr2H4aAAA3NpJmQ (envelope-from ) for ; Tue, 07 Dec 2021 12:03:17 -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: smtp27.gate.iad3b.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: 922db7aa-577f-11ec-9ee9-5254006b1ac1-1-1 Received: from [216.105.38.7] ([216.105.38.7:47214] helo=lists.sourceforge.net) by smtp27.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 01/57-06611-5D39FA16; Tue, 07 Dec 2021 12:03:17 -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 1mudrG-0003Qj-S5; Tue, 07 Dec 2021 17:02:27 +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 1mudrE-0003P4-59 for openvpn-devel@lists.sourceforge.net; Tue, 07 Dec 2021 17:02:25 +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=7mYpSPaw0SRpSHovr+zEwKYBmu4jriqbl/JKZ/F6f/I=; b=Kqx0JfWaI8X3qEGdDOvVAaI2cz ac7mnNy0dyJ8VEgJnTgyWRlw4sfgytrnSx8PsIXPeLWTkj0V0a2egD+z27ho+7oXAzZmfsX3X8c9z 4Au9QyuQXcd4Q62zq4b58kjv5389X9FqAIswBpVWwyuf7CwvZNc2aLK58qTJmi026w+8=; 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=7mYpSPaw0SRpSHovr+zEwKYBmu4jriqbl/JKZ/F6f/I=; b=W3Y/EziQcmJ0LnfTlcAfOe7Ojz VMJTYvKtcNEglHijypwD+mSWiFVbgFAolpFNCwF43k5MoObAmgMPSoCVh68UboM98NsBWJAvqrQ3d 5ZJ7uKlBruKDaA02m0HODUxZ+0mjLvzFHfzdyoBAbbyFWrb5Mi3CF4R2gU7En2KnjgwM=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1mudrD-0006Mx-N5 for openvpn-devel@lists.sourceforge.net; Tue, 07 Dec 2021 17:02:25 +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 1mudr2-000IeT-Nz for openvpn-devel@lists.sourceforge.net; Tue, 07 Dec 2021 18:02:12 +0100 Received: (nullmailer pid 3275939 invoked by uid 10006); Tue, 07 Dec 2021 17:02:13 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Dec 2021 18:02:08 +0100 Message-Id: <20211207170211.3275837-19-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207170211.3275837-1-arne@rfc2549.org> References: <20211207170211.3275837-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: 1mudrD-0006Mx-N5 Subject: [Openvpn-devel] [PATCH 18/21] 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 72ffbfdfc..9d9dfe96a 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -3099,14 +3099,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. */ @@ -3139,17 +3131,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 62a66c8fd..9ca58c1f0 100644 --- a/src/openvpn/mtu.c +++ b/src/openvpn/mtu.c @@ -215,7 +215,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 06a00b5bb..1c479c9f5 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 */ @@ -359,12 +352,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 27a583313..6935e761a 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 9bda2e808..4ab30f55f 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 79a5660bd..d55ffcdd2 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);