summaryrefslogtreecommitdiff
path: root/examples/netfilter/nf-log.c
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-10-18 11:48:55 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2015-10-18 11:48:55 +0100
commitcebada14c32e6603380a913fb852854c46605d1d (patch)
tree88396b80b0a558866002809642876792f3c60de9 /examples/netfilter/nf-log.c
parent0bb90c44862ce3f9018656beadfbc2aac4a0d517 (diff)
parent1891e0e2cefced50e7bfdacd50942cefe5bf73ba (diff)
downloadlibmnl-cebada14c32e6603380a913fb852854c46605d1d.tar.gz
libmnl-cebada14c32e6603380a913fb852854c46605d1d.zip
Merge remote-tracking branch 'source/master' into upstreamupstream
Diffstat (limited to 'examples/netfilter/nf-log.c')
-rw-r--r--examples/netfilter/nf-log.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/examples/netfilter/nf-log.c b/examples/netfilter/nf-log.c
index a862912..4383b66 100644
--- a/examples/netfilter/nf-log.c
+++ b/examples/netfilter/nf-log.c
@@ -9,11 +9,6 @@
#include <libmnl/libmnl.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink.h>
-
-#ifndef aligned_be64
-#define aligned_be64 u_int64_t __attribute__((aligned(8)))
-#endif
-
#include <linux/netfilter/nfnetlink_log.h>
static int parse_attr_cb(const struct nlattr *attr, void *data)
@@ -39,14 +34,14 @@ static int parse_attr_cb(const struct nlattr *attr, void *data)
case NFULA_TIMESTAMP:
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC,
sizeof(struct nfulnl_msg_packet_timestamp)) < 0) {
- perror("mnl_attr_validate");
+ perror("mnl_attr_validate2");
return MNL_CB_ERROR;
}
break;
case NFULA_HWADDR:
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC,
sizeof(struct nfulnl_msg_packet_hw)) < 0) {
- perror("mnl_attr_validate");
+ perror("mnl_attr_validate2");
return MNL_CB_ERROR;
}
break;
@@ -174,28 +169,28 @@ int main(int argc, char *argv[])
nlh = nflog_build_cfg_pf_request(buf, NFULNL_CFG_CMD_PF_UNBIND);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
- perror("mnl_socket_send");
+ perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
nlh = nflog_build_cfg_pf_request(buf, NFULNL_CFG_CMD_PF_BIND);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
- perror("mnl_socket_send");
+ perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
nlh = nflog_build_cfg_request(buf, NFULNL_CFG_CMD_BIND, qnum);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
- perror("mnl_socket_send");
+ perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
nlh = nflog_build_cfg_params(buf, NFULNL_COPY_PACKET, 0xFFFF, qnum);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
- perror("mnl_socket_send");
+ perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}