On Wed, Aug 16, 2000 at 12:23:00PM +0200, Jan Echternach wrote:
> 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.
nlmsghdr has other uses than just handling multipart messages. For
examples it gives you a sequence number so that you can try to detect
lost packets and a way to request acks.
netlink sockets require a nlmsghdr
> 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
> Should NLMSG_* be used on the new NETLINK_NFLOG socket?