All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix definition of NFNL_HEADER_LEN
@ 2005-10-29 13:00 Pablo Neira
  2005-10-31 18:50 ` Harald Welte
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Neira @ 2005-10-29 13:00 UTC (permalink / raw)
  To: Harald Welte; +Cc: Netfilter Development Mailinglist

[-- 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
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix definition of NFNL_HEADER_LEN
  2005-10-29 13:00 [PATCH] Fix definition of NFNL_HEADER_LEN Pablo Neira
@ 2005-10-31 18:50 ` Harald Welte
  0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2005-10-31 18:50 UTC (permalink / raw)
  To: Pablo Neira; +Cc: Netfilter Development Mailinglist

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

On Sat, Oct 29, 2005 at 03:00:57PM +0200, Pablo Neira wrote:
> 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.

thanks, applied.

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

yes, although I have to admit I don't [yet] know how symbol versioning
actually works.

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-31 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-29 13:00 [PATCH] Fix definition of NFNL_HEADER_LEN Pablo Neira
2005-10-31 18:50 ` Harald Welte

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.