Message ID | 20250121161025.37545-1-frank@lichtenheld.com |
---|---|
State | Accepted |
Headers | show |
Series | [Openvpn-devel,v10] mudp.c: keep offset value when resetting buffer | expand |
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 <lev@openvpn.net> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Message-Id: <20250121161025.37545-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30519.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index 6137578..1a3a4c7 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -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;