From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net
Subject: [PATCH 2/2] netfilter: nfnetlink_queue: add definition of aligned_be64 for user-space apps
Date: Mon, 12 Jul 2010 19:00:19 +0200 [thread overview]
Message-ID: <20100712170019.4026.55069.stgit@decadence> (raw)
In-Reply-To: <20100712165241.4026.83949.stgit@decadence>
Currently, libnl and libnetfilter_queue include in one of their
user-space header files an ad-hoc definition of aligned_be64.
However, applications that use the BSD socket API to communicate
via Netlink sockets (ie. those that do not use these libraries)
would need to define this type by hand if they include the
kernel-space header nfnetlink_queue.h.
This patch adds the definition of aligned_bed64 for user-space
applications in the kernel header. Otherwise, they have to define
it to avoid the following compilation problem:
/usr/include/linux/netfilter/nfnetlink_queue.h:28: error: expected specifier-qualifier-list before ‘aligned_be64’
I know, this is ugly but I think that user-space Netlink applications
should compile with the only need of including the kernel-space
header that contains the protocol definitions.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
include/linux/netfilter/nfnetlink_queue.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 2455fe5..5512a35 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -24,6 +24,12 @@ struct nfqnl_msg_packet_hw {
__u8 hw_addr[8];
};
+#ifndef __KERNEL__
+#ifndef aligned_be64
+#define aligned_be64 u_int64_t __attribute__((aligned(8)))
+#endif
+#endif /* !__KERNEL__ */
+
struct nfqnl_msg_packet_timestamp {
aligned_be64 sec;
aligned_be64 usec;
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-07-12 17:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-12 16:59 [PATCH 0/2] A couple of netfilter fixes Pablo Neira Ayuso
2010-07-12 16:59 ` [PATCH 1/2] netfilter: nf_ct_tcp: fix flow recovery with TCP window tracking enabled Pablo Neira Ayuso
2010-07-15 9:16 ` Patrick McHardy
2010-07-15 11:55 ` Pablo Neira Ayuso
2010-07-15 15:10 ` Patrick McHardy
2010-07-12 17:00 ` Pablo Neira Ayuso [this message]
2010-07-15 9:19 ` [PATCH 2/2] netfilter: nfnetlink_queue: add definition of aligned_be64 for user-space apps Patrick McHardy
2010-07-15 11:59 ` Pablo Neira Ayuso
2010-07-15 15:07 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100712170019.4026.55069.stgit@decadence \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).