Make global variables local, and move variables local to while-loop into
the loop.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
#define GROUP 1
-static struct sockaddr_nl local_addr;
-static int sock_fd;
-
-static unsigned char *buf;
-
-static struct xt_pknock_nl_msg *nlmsg;
-
int main(void)
{
int status;
int group = GROUP;
-
- int buf_size;
-
- const char *ip;
- char ipbuf[48];
+ struct sockaddr_nl local_addr;
+ int sock_fd, buf_size;
+ unsigned char *buf;
sock_fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
}
while(1) {
+ struct xt_pknock_nl_msg *nlmsg;
+ const char *ip;
+ char ipbuf[48];
memset(buf, 0, buf_size);
status = recv(sock_fd, buf, buf_size, 0);