Skip to contentSkip to conversation

Change in openvpn[master]: mudp.c: keep offset value when reset buffer

Openvpn-devel In review stipa (Code Review) 3 participants 15 messages Nov 21, 2024 – Jan 31, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1732212459000.I145573555aaace5e94774b5f977d032d3747ed72@...2715...

#1 lore raw

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/+/814?usp=email

to review the following change.

Change subject: mudp.c: keep offset value when reset buffer
......................................................................

mudp.c: keep offset value when reset buffer

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

---
M src/openvpn/mudp.c

1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/814/1

src/openvpn/mudp.c +3 -1
index 5fbd7b0..d8e3d69 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requres prepend with sockaddr, so preserve offset */
+    buf_init(&c->c2.buffers->aux_buf, buf.offset);
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos, stipa.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when reset buffer
......................................................................

Patch Set 1:

(3 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/e9f0fd7c_69e29b82 :
PS1, Line 7: mudp.c: keep offset value when reset buffer "resetting"

File src/openvpn/mudp.c:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/fcb8e952_68fe37ee :
PS1, Line 57: /* dco-win server requres prepend with sockaddr, so preserve offset */
"requires"

http://gerrit.openvpn.net/c/openvpn/+/814/comment/dfafbbbe_9d592c2d :
PS1, Line 58: buf_init(&c->c2.buffers->aux_buf, buf.offset);
buf_init can fail (buf_reset_len cannot). Do we need error handling here?

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Fri, 22 Nov 2024 14:41:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

stipa has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when reset buffer
......................................................................

Patch Set 1:

(3 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/535895da_8fa8d201 :
PS1, Line 7: mudp.c: keep offset value when reset buffer

Quoted 1 line

"resetting"

Acknowledged

File src/openvpn/mudp.c:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/c06e65ab_3f487764 :
PS1, Line 57: /* dco-win server requres prepend with sockaddr, so preserve offset */

Quoted 1 line

"requires"

Acknowledged

http://gerrit.openvpn.net/c/openvpn/+/814/comment/7b8a5279_1096f128 :
PS1, Line 58: buf_init(&c->c2.buffers->aux_buf, buf.offset);

Quoted 1 line

buf_init can fail (buf_reset_len cannot). […]

Will wrap it into ASSERT.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 22 Nov 2024 15:35:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Gerrit-MessageType: comment

#4 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/814?usp=email

to look at the new patch set (#2).

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

mudp.c: keep offset value when resetting buffer

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

---
M src/openvpn/mudp.c

1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/814/2

src/openvpn/mudp.c +3 -1
index 5fbd7b0..bba34ef 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requires prepend with sockaddr, so preserve offset */
+    ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset

#5 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

stipa has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

Patch Set 1:

(1 comment)

File src/openvpn/mudp.c:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/36daad7c_ce89715f :
PS1, Line 58: buf_init(&c->c2.buffers->aux_buf, buf.offset);

Quoted 1 line

Will wrap it into ASSERT.

Acknowledged

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 22 Nov 2024 15:36:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]...>
Comment-In-Reply-To: stipa <[email protected]...>
Gerrit-MessageType: comment

#6 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: plaisthos, stipa.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

Patch Set 10: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 10
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Tue, 21 Jan 2025 16:06:43 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#7 lore raw

PATCH v10 1/1 mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

From: Lev Stipakov <[email protected]...>

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

---

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/+/814
This mail reflects revision 10 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

src/openvpn/mudp.c +3 -1
index 6137578..1a3a4c7 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requires prepend with sockaddr, so preserve offset */
+    ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;
#8 lore raw

[Openvpn-devel] [PATCH applied] Re: mudp.c: keep offset value when resetting buffer

Just for clarification: I'm taking the patch "v10" from the list, while gerrit claims to have a "v12" - this is just due to rebasing and re-pushing, but nothing at all has changed there.

I admit I haven't really closely looked what happens here, but it was stared-at by Frank and Antonio, and both are fine. The ASSERT() is "this can never fail, but if it does, something is really wrong", so we do not expect this to ever misfire ("all other buf_init() calls also have an ASSERT()").

Tested on client and server testbed, with lots of UDP activity :-) - no complaints.

Your patch has been applied to the master branch.

commit bfa5f0bdfe89d181f7b5f7af2ba34ab9357a1d13

Author: Lev Stipakov
Date:   Tue Jan 21 17:10:25 2025 +0100
     mudp.c: keep offset value when resetting buffer

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg30519.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#9 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: plaisthos, stipa.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/814?usp=email

to look at the new patch set (#11).

The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

mudp.c: keep offset value when resetting buffer

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

---
M src/openvpn/mudp.c

1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/814/11

src/openvpn/mudp.c +3 -1
index 4f2bbd7..5f43db9 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requires prepend with sockaddr, so preserve offset */
+    ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 11
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-MessageType: newpatchset

#10 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: plaisthos, stipa.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/814?usp=email

to look at the new patch set (#12).

The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

mudp.c: keep offset value when resetting buffer

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

---
M src/openvpn/mudp.c

1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/814/12

src/openvpn/mudp.c +3 -1
index 4f2bbd7..5f43db9 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requires prepend with sockaddr, so preserve offset */
+    ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 12
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-MessageType: newpatchset

#11 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: plaisthos, stipa.

ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

Patch Set 12:

(1 comment)

File src/openvpn/mudp.c:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/ef68c003_57b839a6 :
PS12, Line 58: ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
under what circumstance do we expect this ASSERT to be triggered?
I am always scared to introduce new ASSERTs because a temporary condition may lead the server to "assert-out" and this may not be nice.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 12
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: ordex <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Thu, 30 Jan 2025 08:44:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

#12 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: ordex, plaisthos.

stipa has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

Patch Set 12:

(1 comment)

File src/openvpn/mudp.c:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/5d94cc70_a4b520cc :
PS12, Line 58: ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));

Quoted 1 line

under what circumstance do we expect this ASSERT to be triggered? […]

buf_init() can in fail if there is not enough capacity, but it should not be the case. In fact, all buf_init() calls except one are wrapped into ASSERT.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 12
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: ordex <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Thu, 30 Jan 2025 09:01:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: ordex <[email protected]...>
Gerrit-MessageType: comment

#13 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

Attention is currently required from: plaisthos, stipa.

ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

Patch Set 12: Code-Review+2

(1 comment)

File src/openvpn/mudp.c:

http://gerrit.openvpn.net/c/openvpn/+/814/comment/7a94e11c_e3978f10 :
PS12, Line 58: ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));

Quoted 1 line

buf_init() can in fail if there is not enough capacity, but it should not be the case. […]

Acknowledged

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 12
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Thu, 30 Jan 2025 09:14:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: ordex <[email protected]...>
Comment-In-Reply-To: stipa <[email protected]...>
Gerrit-MessageType: comment

#14 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

cron2 has uploaded a new patch set (#13) to the change originally created by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld, Code-Review+2 by ordex

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

mudp.c: keep offset value when resetting buffer

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg30519.html

---
M src/openvpn/mudp.c

1 file changed, 3 insertions(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/14/814/13

src/openvpn/mudp.c +3 -1
index 4f2bbd7..5f43db9 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requires prepend with sockaddr, so preserve offset */
+    ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 13
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#15 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: mudp.c: keep offset value when resetting buffer

In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/814?usp=email )

Change subject: mudp.c: keep offset value when resetting buffer
......................................................................

mudp.c: keep offset value when resetting buffer

dco-win requires control packets to be prepended with sockaddr. For that, an offset value in buffer must be kept. Doing it always doesn't harm and makes code cleaner compared to adding "if (dco_win_server)" condition.

Change-Id I145573555aaace5e94774b5f977d032d3747ed72

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg30519.html

---
M src/openvpn/mudp.c

1 file changed, 3 insertions(+), 1 deletion(-)
src/openvpn/mudp.c +3 -1
index 4f2bbd7..5f43db9 100644
@@ -54,7 +54,9 @@
 
     struct context *c = &m->top;
 
-    buf_reset_len(&c->c2.buffers->aux_buf);
+    /* dco-win server requires prepend with sockaddr, so preserve offset */
+    ASSERT(buf_init(&c->c2.buffers->aux_buf, buf.offset));
+
     buf_copy(&c->c2.buffers->aux_buf, &buf);
     m->hmac_reply = c->c2.buffers->aux_buf;
     m->hmac_reply_dest = &m->top.c2.from;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/814?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I145573555aaace5e94774b5f977d032d3747ed72
Gerrit-Change-Number: 814
Gerrit-PatchSet: 13
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: ordex <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged