Re: iproute2 struct alignment issue with cris architecture

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

 



Andy Gay <andy@xxxxxxxxxxx> wrote:
> 
> The policy print errors can be fixed by this patch (this is against
> iproute2-2.6.16-060323):
> # diff -u --show-c-function xfrm_policy.c~ xfrm_policy.c
> --- xfrm_policy.c~      2005-11-07 13:39:30.000000000 -0500
> +++ xfrm_policy.c       2006-06-07 18:29:13.000000000 -0400
> @@ -362,7 +362,7 @@ int xfrm_policy_print(const struct socka
>        } else {
>                xpexp = NULL;
>                xpinfo = NLMSG_DATA(n);
> -               len -= NLMSG_LENGTH(sizeof(*xpinfo));
> +               len -= NLMSG_LENGTH(NLMSG_ALIGN(sizeof(*xpinfo)));
>        }
> 
>        if (len < 0) {

A shorter way to write this is

		len -= NLMSG_SPACE(sizeof(*xpinfo);

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