Re: iproute2 struct alignment issue with cris architecture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 09, 2006 at 01:16:00AM -0400, Andy Gay wrote:
>
> Yes, that works as well (I tried it!). Interesting... My patch was using
> a construction of the form 
>   NLMSG_LENGTH(NLMSG_ALIGN(len))
> while the first level expansion of NLMSG_SPACE(len) is
>   NLMSG_ALIGN(NLMSG_LENGTH(len))
> 
> Since it works both ways, it appears NLMSG_ALIGN and NLMSG_LENGTH can be
> used in either order. Is that guaranteed, I wonder?

Absolutely:

NLMSG_ALIGN(NLMSG_LENGTH(len)) =
	NLMSG_ALIGN(len + NLMSG_ALIGN(NLMSG_HDRLEN)) =
	NLMSG_ALIGN(len) + NLMSG_ALIGN(NLMSG_HDRLEN) =
	NLMSG_LENGTH(NLMSG_ALIGN(len))

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux