]> git.ipfire.org Git - thirdparty/openvpn.git/commit
cleanup: merge packet_id_alloc_outgoing() into packet_id_write()
authorSteffan Karger <steffan.karger@fox-it.com>
Tue, 9 May 2017 19:10:36 +0000 (21:10 +0200)
committerDavid Sommerseth <davids@openvpn.net>
Tue, 9 May 2017 19:36:04 +0000 (21:36 +0200)
commit5d747770efa0611cc6cfeb6b3a5853bf51046d53
treee997258273c144af9bc541a3d87cfa50e9fc4c75
parent895abd4be776b792a5f8909eaf2a5b110798a435
cleanup: merge packet_id_alloc_outgoing() into packet_id_write()

The functions packet_id_alloc_outgoing() and packet_id_write() were
always called in tandem.  Instead of forcing the caller to allocate a
packet_id_net to do so, merge the two functions.  This simplifies the API
and reduces the chance on mistakes in the future.

This patch adds unit tests to verify the behaviour of packet_id_write().
Verifying that we assert out correctly required the change to mock_msg.c.

This patch was cherry-picked from a87e1431 (master).

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <1494357036-3529-1-git-send-email-steffan.karger@fox-it.com>
URL: http://www.mail-archive.com/search?l=mid&q=1494357036-3529-1-git-send-email-steffan.karger@fox-it.com
Signed-off-by: David Sommerseth <davids@openvpn.net>
configure.ac
src/openvpn/crypto.c
src/openvpn/packet_id.c
src/openvpn/packet_id.h
tests/unit_tests/Makefile.am
tests/unit_tests/openvpn/Makefile.am [new file with mode: 0644]
tests/unit_tests/openvpn/mock_msg.c [new file with mode: 0644]
tests/unit_tests/openvpn/mock_msg.h [new file with mode: 0644]
tests/unit_tests/openvpn/test_packet_id.c [new file with mode: 0644]