netdev
[Top] [All Lists]

Re: NLMSG_* macros (was: Re: ULOG comments)

To: Andi Kleen <ak@xxxxxx>
Subject: Re: NLMSG_* macros (was: Re: ULOG comments)
From: Jan Echternach <echter@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Aug 2000 12:22:31 +0200
Cc: netfilter@xxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20000815224633.53823@xxxxxxxxxxxx>; from ak@xxxxxx on Tue, Aug 15, 2000 at 10:46:34PM +0200
Mail-followup-to: Andi Kleen <ak@xxxxxx>, netfilter@xxxxxxxxx, netdev@xxxxxxxxxxx
References: <20000811162634.A3814@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.10.10008120119370.13569-100000@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20000815175225.B26543@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20000815181812.A5358@xxxxxxxxxxx> <20000815182512.D26543@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20000815224633.53823@xxxxxxxxxxxx>
Reply-to: Jan Echternach <jan.echternach@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Tue, Aug 15, 2000 at 10:46:34PM +0200, Andi Kleen wrote:
> On Tue, Aug 15, 2000 at 06:25:29PM +0200, Jan Echternach wrote:
> > On Tue, Aug 15, 2000 at 06:18:12PM +0200, Andi Kleen wrote:
> > But there are absolutely no alignement problems with single-part
> > messages.  Actually, there are even fewer alignment problems without
> 
> There is between the header and the payload.

I'm sorry that I didn't represent the issue clearly.  I understand that
user space code should also use NLMSG_* if the kernel uses it.

Ipchains in Linux-2.2 uses a simple structure without padding on the
NETLINK_FIREWALL socket.  But netfilter in 2.4 puts a nlmsghdr before a
similar structure, even though it doesn't use its multipart feature.
The new ULOG target on the new NETLINK_NFLOG type socket also uses
NLMSG_* without ever producing multipart messages.  There seems to be a
strong tendency among the netfilter developers to wrap everything in a
nlmsghdr structure.

It's not too late to change the datagram formats on NETLINK_NFLOG.  I
think NLMSG_* only makes the data larger and the code more complex and
less readable.  There is no inherent padding in the data here, there
wouldn't be any alignment problems in the first place if NLMSG_* wasn't
used.

Should NLMSG_* be used on the new NETLINK_NFLOG socket?

-- 
Jan

<Prev in Thread] Current Thread [Next in Thread>