From de4f6e8994117103d6049717e3b7f5a2dc0ae98b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 12 Oct 2009 18:53:03 +0200 Subject: [PATCH] pknlusr: fix up standard errors in pknlusr --- extensions/pknock/pknlusr.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/extensions/pknock/pknlusr.c b/extensions/pknock/pknlusr.c index 01ddcdc..c1d0ff2 100644 --- a/extensions/pknock/pknlusr.c +++ b/extensions/pknock/pknlusr.c @@ -12,15 +12,16 @@ #define GROUP 1 -struct sockaddr_nl src_addr, dest_addr; -struct msghdr msg; -int sock_fd; +static struct sockaddr_nl src_addr, dest_addr; +static struct msghdr msg; +static int sock_fd; -unsigned char *buf = NULL; +static unsigned char *buf; -struct xt_pknock_nl_msg *nlmsg; +static struct xt_pknock_nl_msg *nlmsg; -int main() { +int main(void) +{ socklen_t addrlen; int status; int group = GROUP; @@ -57,7 +58,7 @@ int main() { dest_addr.nl_groups = group; buf_size = sizeof(struct xt_pknock_nl_msg) + sizeof(struct cn_msg) + sizeof(struct nlmsghdr); - buf = (unsigned char *) malloc(buf_size); + buf = malloc(buf_size); if (!buf) { perror("malloc()");