]> git.feebdaed.xyz Git - 0xmirror/openvpn.git/commit
PUSH_UPDATE: fix option reset logic in continuation messages
authorMoritz Fain <moritz-openvpn@fain.io>
Mon, 1 Dec 2025 14:04:18 +0000 (15:04 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 10 Dec 2025 11:34:16 +0000 (12:34 +0100)
commit309c2332c353e741d0b696112891cbe0a8e4080f
treef42f698c3ab7acab7e62dd32e4cdfb57952ab35c
parent8bf8bead6d7cc3c743fdf2b915fbb2f3f24e7005
PUSH_UPDATE: fix option reset logic in continuation messages

Previously, the logic for resetting push options (like 'route') was based on
`update_options_found` which was local to `apply_push_options`. This meant
that if a PUSH_UPDATE was split across multiple continuation messages,
the state was lost, causing routes to be reset multiple times (once per
message chunk) rather than once per update sequence.

This patch moves the state tracking to `struct options` as
`push_update_options_found`, allowing it to persist across the entire
PUSH_UPDATE sequence.

This fixes an issue where large route lists sent via PUSH_UPDATE would
result in only the last chunk's routes being applied, or previous routes
being continuously deleted and re-added.

Added unit test `test_incoming_push_continuation_route_accumulation` to
verify the fix.

Github: OpenVPN/openvpn#925

Signed-off-by: Moritz Fain <moritz-openvpn@fain.io>
Acked-by: Marco Baffo <marco@mandelbit.com>
Message-Id: <CAM8w-qEE6vHj=yUOpTFbM7DqPKzUV0NupvEG4rUefY=kNB2DxQ@mail.gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34814.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c
src/openvpn/options.h
src/openvpn/options_parse.c
src/openvpn/push.c
tests/unit_tests/openvpn/test_options_parse.c
tests/unit_tests/openvpn/test_push_update_msg.c