[Openvpn-devel,v3] push-update-server: comment about buf_string_compare_advance() usage in send_single_push_update()

Message ID 20250912131519.43222-1-frank@lichtenheld.com
State New
Headers show
Series [Openvpn-devel,v3] push-update-server: comment about buf_string_compare_advance() usage in send_single_push_update() | expand

Commit Message

Frank Lichtenheld Sept. 12, 2025, 1:15 p.m. UTC
From: Marco Baffo <marco@mandelbit.com>

Change-Id: I73f8ad9bf105920f4bde357ea9dcf0e485f3f3cb
Signed-off-by: Marco Baffo <marco@mandelbit.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
---

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

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>

Comments

Gert Doering Sept. 12, 2025, 3:36 p.m. UTC | #1
Since this is only a comment, no testing is needed - and the comment
itself has been reviewed.

URLs pointing to sf.net archive + gerrit again.

Your patch has been applied to the master branch.

commit 6a9843ce740760e866dbbf858335a56afe4decf7
Author: Marco Baffo
Date:   Fri Sep 12 15:15:19 2025 +0200

     push-update-server: comment about buf_string_compare_advance() usage in send_single_push_update()

     Signed-off-by: Marco Baffo <marco@mandelbit.com>
     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Message-Id: <20250912131519.43222-1-frank@lichtenheld.com>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59232447/
     URL: https://gerrit.openvpn.net/c/openvpn/+/1177
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c
index bd3992b..f7a4fca 100644
--- a/src/openvpn/push_util.c
+++ b/src/openvpn/push_util.c
@@ -161,6 +161,10 @@ 
          * will not be routed towards the client.
          * For the same reason we later update the vhash too in
          * `send_push_update()` function.
+         * Using `buf_string_compare_advance()` we mimic the behavior
+         * inside `process_incoming_push_msg()`. However, we don't need
+         * to check the return value here because we just want to `advance`,
+         * meaning we skip the `push_update_cmd' we added earlier.
          */
         buf_string_compare_advance(&msgs[i], push_update_cmd);
         if (process_incoming_push_update(c, pull_permission_mask(c), option_types_found, &msgs[i], true) == PUSH_MSG_ERROR)