From: "stipa (Code Review)" Date: Thu, 20 Feb 2025 07:40:26 +0000 References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <6e4ca50667afb356e895dfe791f872ef67d9af99-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Zq8BejSmeZg="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco-win: simplify control packets prepend code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --Zq8BejSmeZg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/900?usp=3Demail to review the following change. Change subject: dco-win: simplify control packets prepend code ...................................................................... dco-win: simplify control packets prepend code Eliminate unneeded temporary struct sockaddr_in buffer. Change-Id: Ie57f7b11157ab5ca8ff01e1c4f03a308117ff937 Signed-off-by: Lev Stipakov --- M src/openvpn/socket.h 1 file changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/00/900/1 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 =3D=3D 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 sock= addr_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 socka= ddr_in6)); } } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/900?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie57f7b11157ab5ca8ff01e1c4f03a308117ff937 Gerrit-Change-Number: 900 Gerrit-PatchSet: 1 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --Zq8BejSmeZg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

stipa would like plaisthos and flichtenheld to review t= his change.

Vi= ew Change

dco-win: simplify control packets prepend code

Elimina= te unneeded temporary struct sockaddr_in buffer.

Change-Id: Ie57f7b1= 1157ab5ca8ff01e1c4f03a308117ff937
Signed-off-by: Lev Stipakov <lev@...1186...= .515...>
---
M src/openvpn/socket.h
1 file changed, 2 insertion= s(+), 6 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/open=
vpn refs/changes/00/900/1
diff --git a/src/openvpn/socket.h b/src/o=
penvpn/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 =3D=3D AF_INET)

{
- = struct sockaddr_in sa;
- memcpy(&sa, &to->dest.addr.in4, sizeof(sa));

- buf_write_pre= pend(buf, &sa, sizeof(sa));
+ buf_write_prepend(buf, &to->dest.addr.in4, = sizeof(struct sockaddr_in));
}
= else
{
- struct sockaddr_in6 sa;
- memcpy(&sa, &to->des= t.addr.in6, sizeof(sa));
+ buf_write_prepend(buf, = &to->dest.addr.in6, sizeof(struct sockaddr_in6));
= }
}

To view, visit change 900. To unsubscribe, or for help writing mail f= ilters, visit settings.<= /p>

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie57f7b11157ab5ca8ff01e1c4f0= 3a308117ff937
Gerrit-Change-Number: 900
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--Zq8BejSmeZg=--