From patchwork Thu Feb 20 07:43:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4153 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:9b51:b0:5e7:b9eb:58e8 with SMTP id b17csp3414260max; Wed, 19 Feb 2025 23:43:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWqc/5WXLFzmFrKnvVBOtbUAeWOKgXI34g3EMoSL+u6GrM296vbQ6FhYafGTGeXMSCXRApfma+Hl7A=@openvpn.net X-Google-Smtp-Source: AGHT+IGOG+bD2lPj4LPdXDOI6pXCHWU2Zp6pUozYcAy6kbZz9w1lIHpI0Oc3C+unnq43LHBjnl4k X-Received: by 2002:a05:6808:2009:b0:3f4:28:1cf9 with SMTP id 5614622812f47-3f40f24c70bmr5688664b6e.37.1740037429067; Wed, 19 Feb 2025 23:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740037429; cv=none; d=google.com; s=arc-20240605; b=cbrRpRxOeTrmV2Ry7TKIcuVxHhIyk25ME2RSbwFrEqVwonoMK6c6AfSxI2c4SGmlww Qw1ffFkr+JL1rYjyfhRAlEojz3+hEcCZpXkclyqgiCQMwI9XppVFdfWqzvhI3qhFb3qr ReY4WWx6a73aW9OVNaJOSPma6rxoRT+rq6vtKoK+wfj1frPnH5VOAV/uNOYtLL6Oa+0/ GKP8+nNVLc0uOyjEl3UUsa1bTaHMCPlhGIiJdoVHO0lY0C5fGpxB31VowrzhErnHjlMN j2v0iL90r91Dp/yqocPvHOiedluOczZJ3AVx140VIzOuf9lYiYytK8mi6KaGl7IpvfqZ BznQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=Tv9pD0HfxEEl9DJNVZBrzLnzXXz8cEnS9g1k9GIL6hA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=GahRJa+7gEDM4MWMC5ptD5SJMZKPU7JbDJL5BfuC/PfoI0sJMdawIt32WQn3xbbOpS zdEeUDCCn7BTclwZGKaUiJ1N36PnTdpO8XtGLMMgHeeA/IfQmcgLBooBL3hV5l+qzeYb VmOjcUd4uIBApSnSKt1cMZMYU2kq1f6CwrH+q+vNUXtLgABVf/c/GLLFO/ewTtkyUW8+ dmly6mkIZSaLAmiVaDCrRsYViurmbAALF91Ky2TpSf0R+OaDy4WksP1pozNhIEfiDAxE f2TCfztosb8SJDg03BQ3geZufjNBAWiZvNxPS70pBc7FJcwxWyz0qmXzaIT/h4ZFYjOY RGBA==; 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="RZ+tCRR/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=K1UqgGqe; 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=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5614622812f47-3f412707dd4si2643749b6e.199.2025.02.19.23.43.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Feb 2025 23:43:48 -0800 (PST) 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="RZ+tCRR/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=K1UqgGqe; 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=muc.de Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tl1Dl-00081s-9t; Thu, 20 Feb 2025 07:43:45 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tl1Dj-00081g-R4 for openvpn-devel@lists.sourceforge.net; Thu, 20 Feb 2025 07:43:43 +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=1T/6an2RZSP8SkmqkCZMmsxEYkHr3XFK8Equ4fHXhBs=; b=RZ+tCRR/g3IHhEOs1GXmDHErrJ 7dXLZVT2SDBfVBNWtFaXN9MvX9CkySy+TJZB/4JIl48t7dczyKggvM/irfYomTWIspwMfmIoz7e7L TRZgO5zbKpnbGNS5B+vRDOBdgi+CaDbSeSnXV4ZbzhdE99TSKfFWzMz60k2UbKbsZvIY=; 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=1T/6an2RZSP8SkmqkCZMmsxEYkHr3XFK8Equ4fHXhBs=; b=K1UqgGqeL3PXUM+83rPiR1GzGk JVDUDjGCSlbE95OZAk/wFTdTy+//Ezr8oXc3nAd+h6EObNG4bxTENTw1JB9lZr3k4YQc0iP1yZy1Y OTrLaXldHzEZtIWQJFDe9aeLRYV8AN7bjfcptxK9jDZf1ENATg2AGk/PlBTYlnYdDjnk=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tl1Db-0005ue-Ly for openvpn-devel@lists.sourceforge.net; Thu, 20 Feb 2025 07:43:36 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 51K7hT7I024932 for ; Thu, 20 Feb 2025 08:43:29 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 51K7hTcp024931 for openvpn-devel@lists.sourceforge.net; Thu, 20 Feb 2025 08:43:29 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 20 Feb 2025 08:43:27 +0100 Message-ID: <20250220074327.24922-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.0 (/) 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: From: Lev Stipakov Eliminate unneeded temporary struct sockaddr_in buffer. Change-Id: Ie57f7b11157ab5ca8ff01e1c4f03a308117ff937 Signed-off-by: Lev Stipakov Acked-by: Gert Doering --- Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in bl.score.senderscore.com] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in sa-trusted.bondedsender.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1tl1Db-0005ue-Ly Subject: [Openvpn-devel] [PATCH v1] dco-win: simplify control packets prepend code 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 X-GMAIL-THRID: =?utf-8?q?1824561486921277886?= X-GMAIL-MSGID: =?utf-8?q?1824561486921277886?= From: Lev Stipakov Eliminate unneeded temporary struct sockaddr_in buffer. Change-Id: Ie57f7b11157ab5ca8ff01e1c4f03a308117ff937 Signed-off-by: Lev Stipakov Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/900 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h index c370f2c..ee04a96 100644 --- a/src/openvpn/socket.h +++ b/src/openvpn/socket.h @@ -1125,15 +1125,11 @@ { if (to->dest.addr.sa.sa_family == AF_INET) { - struct sockaddr_in sa; - memcpy(&sa, &to->dest.addr.in4, sizeof(sa)); - buf_write_prepend(buf, &sa, sizeof(sa)); + buf_write_prepend(buf, &to->dest.addr.in4, sizeof(struct sockaddr_in)); } else { - struct sockaddr_in6 sa; - memcpy(&sa, &to->dest.addr.in6, sizeof(sa)); - buf_write_prepend(buf, &sa, sizeof(sa)); + buf_write_prepend(buf, &to->dest.addr.in6, sizeof(struct sockaddr_in6)); } }