]> git.ipfire.org Git - thirdparty/openvpn.git/commit
mss/mtu: make all size calculations use size_t
authorFrank Lichtenheld <frank@lichtenheld.com>
Sun, 8 Oct 2023 10:40:22 +0000 (12:40 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 19 Oct 2023 14:13:21 +0000 (16:13 +0200)
commit00685421aefcc294581d6e74371e744acdce6bbf
treeee9183d7652c77f494e4f05938f306a1a808a005
parent7c637b35038e4cc7d2f16e07f413cfa2b0f1f97a
mss/mtu: make all size calculations use size_t

Half of them used unsigned int, the other half size_t.
Standardize on one. Could've also standardized on the
other, both are much too big for the expected numbers
anyway.

Add a new utility function clamp_size_to_int for
cases we need to change from size_t to int (there
are a lot of those all over our codebase).

Resolves some -Wconversion warnings.

Change-Id: Ic996eca227d9e68279a454db93fcbc86a7bd0380
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20231008104022.20200-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/search?l=mid&q=20231008104022.20200-1-frank@lichtenheld.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/integer.h
src/openvpn/mss.c
src/openvpn/mtu.c