]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
pknlusr: use macro to define inet_ntop buffer size
authorJeremy Sowden <jeremy@azazel.net>
Sun, 25 Oct 2020 13:15:52 +0000 (14:15 +0100)
committerJan Engelhardt <jengelh@inai.de>
Sun, 25 Oct 2020 14:01:18 +0000 (15:01 +0100)
POSIX provides a macro to define the minimum length required, so let's
use it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
extensions/pknock/pknlusr.c

index 6fe1d4a337e708b2cd9faa6ab5aa37f860443d13..16a9af917767ad9dfb363013487bc7e0e0bea028 100644 (file)
@@ -47,7 +47,7 @@ int main(void)
 
        while(1) {
                const char *ip;
-               char ipbuf[48];
+               char ipbuf[INET_ADDRSTRLEN];
 
                memset(nlmsg, 0, nlmsg_size);
                status = recv(sock_fd, nlmsg, nlmsg_size, 0);