All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira <pablo@eurodev.net>
To: Harald Welte <laforge@netfilter.org>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH] Fix definition of NFNL_HEADER_LEN
Date: Sat, 29 Oct 2005 15:00:57 +0200	[thread overview]
Message-ID: <43637289.7020403@eurodev.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

Hi Harald,

The current definition of NFNL_HEADER_LEN isn't OK. NLMSG_LENGTH already 
includes the size of the netlink header. We have to use NLMSG_ALIGN 
instead. NLMSG_LENGTH is a bit misleading, I didn't notice this at first 
sight either.

BTW, I think that we should add some kind of versioning of libnfnetlink 
as well, still missing.

cheers,
Pablo

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 834 bytes --]

Index: include/libnfnetlink/libnfnetlink.h
===================================================================
--- include/libnfnetlink/libnfnetlink.h	(revision 4394)
+++ include/libnfnetlink/libnfnetlink.h	(working copy)
@@ -1,6 +1,9 @@
 /* libnfnetlink.h: Header file for generic netfilter netlink interface
  *
  * (C) 2002 Harald Welte <laforge@gnumonks.org>
+ *
+ * 2005-10-29 Pablo Neira Ayuso <pablo@netfilter.org>:
+ * 	Fix NFNL_HEADER_LEN
  */
 
 #ifndef __LIBNFNETLINK_H
@@ -18,8 +21,8 @@
 #define NLMSG_TAIL(nlh) \
 	(((void *) (nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))
 
-#define NFNL_HEADER_LEN	(NLMSG_LENGTH(sizeof(struct nlmsghdr))	\
-			 +NLMSG_LENGTH(sizeof(struct nfgenmsg)))
+#define NFNL_HEADER_LEN	(NLMSG_ALIGN(sizeof(struct nlmsghdr))	\
+			 +NLMSG_ALIGN(sizeof(struct nfgenmsg)))
 
 #define NFNL_BUFFSIZE		8192
 

             reply	other threads:[~2005-10-29 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-29 13:00 Pablo Neira [this message]
2005-10-31 18:50 ` [PATCH] Fix definition of NFNL_HEADER_LEN Harald Welte

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=43637289.7020403@eurodev.net \
    --to=pablo@eurodev.net \
    --cc=laforge@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.