netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rob Sterenborg (lists)" <lists@sterenborg.info>
To: netfilter@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [ANNOUNCE] libmnl 1.0.0 release
Date: Sat, 18 Dec 2010 06:23:44 +0100	[thread overview]
Message-ID: <1292649824.2371.14.camel@kushiel.sterenborg.info> (raw)
In-Reply-To: <4D0B71C3.7030806@netfilter.org>

On Fri, 2010-12-17 at 15:20 +0100, Pablo Neira Ayuso wrote:
> Hi!
> 
> The Netfilter project presents libmnl-1.0.0

Hi,

I have a CentOS 5.5 base with a 2.6.36.2 kernel installed. When
compiling libmnl I got these errors:

nlmsg.c: In function 'mnl_nlmsg_fprintf_payload':
nlmsg.c:274: error: 'NLA_TYPE_MASK' undeclared (first use in this
function)
nlmsg.c:274: error: (Each undeclared identifier is reported only once
nlmsg.c:274: error: for each function it appears in.)
nlmsg.c:290: error: 'NLA_F_NESTED' undeclared (first use in this
function)
nlmsg.c:292: error: 'NLA_F_NET_BYTEORDER' undeclared (first use in this
function)
make: *** [nlmsg.lo] Error 1

NLA_TYPE_MASK is used in nlmsg.c and attr.c. Searching I found that it
should be defined in linux/netlink.h but it's not there.

To make it compile, I did the following.

New file nla.h:

/*
* nla_type (16 bits)
* +---+---+-------------------------------+
* | N | O | Attribute Type                |
* +---+---+-------------------------------+
* N := Carries nested attributes
* O := Payload stored in network byte order
*
* Note: The N and O flag are mutually exclusive.
*/

#define NLA_F_NESTED            (1 << 15)
#define NLA_F_NET_BYTEORDER     (1 << 14)
#define NLA_TYPE_MASK           ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)

These changes in nlmsg.c and attr.c:

--- attr.c.orig 2010-12-18 07:16:51.000000000 +0100
+++ attr.c      2010-12-18 07:16:05.000000000 +0100
@@ -11,6 +11,9 @@
 #include <string.h>
 #include <values.h>    /* for INT_MAX */
 #include <errno.h>
+#ifndef NLA_TYPE_MASK
+#include "nla.h"
+#endif
 #include "internal.h"
 
 /**

--- nlmsg.c.orig        2010-12-18 07:16:56.000000000 +0100
+++ nlmsg.c     2010-12-18 07:16:10.000000000 +0100
@@ -13,6 +13,9 @@
 #include <errno.h>
 #include <string.h>
 #include <libmnl/libmnl.h>
+#ifndef NLA_TYPE_MASK
+#include "nla.h"
+#endif
 #include "internal.h"
 
 /**

After this change, I get no errors when compiling libmnl.
I am not a C programmer, so: is the above the correct way?


Thanks,
Rob



  reply	other threads:[~2010-12-18  5:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 14:20 [ANNOUNCE] libmnl 1.0.0 release Pablo Neira Ayuso
2010-12-18  5:23 ` Rob Sterenborg (lists) [this message]
2010-12-18 12:40   ` Pablo Neira Ayuso
2010-12-18 12:53     ` Pablo Neira Ayuso
2010-12-18 15:35     ` Jan Engelhardt
2010-12-21 20:19       ` Pablo Neira Ayuso
2010-12-21 20:22         ` David Miller
2010-12-21 20:31           ` Pablo Neira Ayuso
2010-12-22 19:52   ` Pablo Neira Ayuso

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=1292649824.2371.14.camel@kushiel.sterenborg.info \
    --to=lists@sterenborg.info \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@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).