mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 12:45:13 +02:00
pknock: fix pknlusr compile warnings
pknlusr.c: In function "main": pknlusr.c:81:25: warning: cast to pointer from integer of different size pknlusr.c:81:7: warning: cast to pointer from integer of different size
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/connector.h>
|
#include <linux/connector.h>
|
||||||
|
|
||||||
@@ -28,7 +28,8 @@ int main() {
|
|||||||
|
|
||||||
int i, buf_size;
|
int i, buf_size;
|
||||||
|
|
||||||
char *ip;
|
const char *ip;
|
||||||
|
char ipbuf[48];
|
||||||
|
|
||||||
sock_fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
|
sock_fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ int main() {
|
|||||||
|
|
||||||
nlmsg = (struct xt_pknock_nl_msg *) (buf + sizeof(struct cn_msg) + sizeof(struct nlmsghdr));
|
nlmsg = (struct xt_pknock_nl_msg *) (buf + sizeof(struct cn_msg) + sizeof(struct nlmsghdr));
|
||||||
|
|
||||||
ip = (char *)inet_ntoa((struct in_addr *) htonl(nlmsg->peer_ip));
|
ip = inet_ntop(AF_INET, &nlmsg->peer_ip, ipbuf, sizeof(ipbuf));
|
||||||
printf("rule_name: %s - ip %s\n", nlmsg->rule_name, ip);
|
printf("rule_name: %s - ip %s\n", nlmsg->rule_name, ip);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user