]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
db, IP2BIN: correct `format_ipv6()` output buffer sizes
authorJeremy Sowden <jeremy@azazel.net>
Mon, 26 May 2025 17:19:01 +0000 (18:19 +0100)
committerFlorian Westphal <fw@strlen.de>
Sun, 1 Jun 2025 12:12:47 +0000 (14:12 +0200)
commit6498d29aa15557428aa62f37c478a602e03bd740
tree3a56cbbf145875ee5943030b43860f51d71abd8e
parent512a0d4915bfd9c47196deed5ef27710b4418491
db, IP2BIN: correct `format_ipv6()` output buffer sizes

`format_ipv6()` formats IPv6 addresses as hex-strings.  However, sizing for the
output buffer is not done quite right.

The elements of the `ipbin_array` array in ulogd_filter_IP2BIN.c are sized using
a local macro, `IPADDR_LENGTH`, which is defined as 128, the number of bits in
an IPv6 address; this is much larger than necessary.

Define an appropriate macro and use that instead.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
filter/ulogd_filter_IP2BIN.c
include/ulogd/ulogd.h
util/db.c