From: Jeremy Sowden Date: Sun, 25 Oct 2020 13:15:52 +0000 (+0100) Subject: pknlusr: use macro to define inet_ntop buffer size X-Git-Tag: v3.12~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0a1aacd4b726d59a3e70e3b78223106667163a5;p=thirdparty%2Fxtables-addons.git pknlusr: use macro to define inet_ntop buffer size POSIX provides a macro to define the minimum length required, so let's use it. Signed-off-by: Jeremy Sowden --- diff --git a/extensions/pknock/pknlusr.c b/extensions/pknock/pknlusr.c index 6fe1d4a..16a9af9 100644 --- a/extensions/pknock/pknlusr.c +++ b/extensions/pknock/pknlusr.c @@ -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);