The elements of the `ipstr_array` array are `IPADDR_LENGTH` bytes long where
`IPADDR_LENGTH` is a local macro defined as 128. However, this is the number of
bits in an IPv6 address, but the elements of `ipstr_array` only need to be big
enough to be used for the output of `inet_ntop`. Use the standard
`INET6_ADDRSTRLEN` macro instead.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
#include <ulogd/ulogd.h>
#include <netinet/if_ether.h>
-#define IPADDR_LENGTH 128
-
enum input_keys {
KEY_OOB_FAMILY,
KEY_OOB_PROTOCOL,
},
};
-static char ipstr_array[MAX_KEY - START_KEY + 1][IPADDR_LENGTH];
+static char ipstr_array[MAX_KEY - START_KEY + 1][INET6_ADDRSTRLEN];
static int ip2str(struct ulogd_key *inp, int index, int oindex)
{