On Mon, 2016-04-18 at 23:41 -0400, David Miller wrote:
>  
> +     /* Add a zero length NOP attribute so that the nla_data()
> +      * of the IFLA_STATS64 will be 64-bit aligned.
> +      */
> +#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
> +     attr = nla_reserve(skb, IFLA_PAD, 0);
> +     if (!attr)
> +             return -EMSGSIZE;
> +#endif

You must do this only if current skb->data alignment is not correct.

(IFLA_ALIAS for example could shift your expectations)

Also you probably want to change if_nlmsg_size() to add
 + nla_total_size(0) /* IFLA_PAD */




Reply via email to