netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Fan Du <fan.du@windriver.com>
Cc: steffen.klassert@secunet.com, davem@davemloft.net,
	stephen@networkplumber.org, dev@lists.strongswan.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] include/uapi/linux/xfrm.h: Pack struct xfrm_userpolicy_info
Date: Fri, 10 Jan 2014 02:07:19 +0300	[thread overview]
Message-ID: <52CF2BA7.9080408@cogentembedded.com> (raw)
In-Reply-To: <52CF29B1.1000905@cogentembedded.com>

On 01/10/2014 01:58 AM, Sergei Shtylyov wrote:

>>>> Otherwise 64bits kernel has sizeof(struct xfrm_userpolicy_info) 168 bytes,
>>>> while 32bits compiled iproute2 see the same structure as 164 bytes, which
>>>> leading deficit xfrm policy, in turn broken IPsec connectivity.

>>>> Fix this by packing the structure.

>>>     This will force byte-by-byte access to all members on some arches like
>>> ARM...

>>>> Signed-off-by: Fan Du <fan.du@windriver.com>
>>>> ---
>>>>   include/uapi/linux/xfrm.h |    2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)

>>>> diff --git a/include/uapi/linux/xfrm.h b/include/uapi/linux/xfrm.h
>>>> index a8cd6a4..470bfae 100644
>>>> --- a/include/uapi/linux/xfrm.h
>>>> +++ b/include/uapi/linux/xfrm.h
>>>> @@ -405,7 +405,7 @@ struct xfrm_userpolicy_info {
>>>>       /* Automatically expand selector to include matching ICMP payloads. */
>>>>   #define XFRM_POLICY_ICMP    2
>>>>       __u8                share;
>>>> -};
>>>> +} __attribute__((packed));

>>>     Please use the __packed macro instead. I guess you haven't run
>>> checkpatch.pl?

>> Lucky me, I run checkpatch every time before sending patch out.

>     Ah, this time it didn't have the *struct* start in the context, so that's
> why there was no complaint (probably). Usually, it suggests using __packed...

    Ah, no. Looking at the script, it just doesn't WARN about this in the 
files under include/uapi/. Probably the macro is undefined in this context.

WBR, Sergei

  reply	other threads:[~2014-01-09 22:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07  6:48 [PATCH net-next 0/2] Pack struct xfrm_usersa_info and struct xfrm_userpolicy_info Fan Du
2014-01-07  6:48 ` [PATCH net-next 1/2] include/uapi/linux/xfrm.h: Pack " Fan Du
2014-01-07 22:52   ` Sergei Shtylyov
2014-01-09  8:39     ` Fan Du
2014-01-09 22:58       ` Sergei Shtylyov
2014-01-09 23:07         ` Sergei Shtylyov [this message]
2014-01-07  6:48 ` [PATCH net-next 2/2] include/uapi/linux/xfrm.h: Pack struct xfrm_usersa_info Fan Du
2014-01-08 20:33   ` Ben Hutchings
2014-01-09  8:24     ` Fan Du
2014-01-09 18:58       ` Ben Hutchings
2014-01-07  6:55 ` [PATCH net-next 0/2] Pack struct xfrm_usersa_info and struct xfrm_userpolicy_info Fan Du
2014-01-07  7:47 ` Steffen Klassert
2014-01-07  7:59   ` Fan Du
2014-01-07 10:00     ` David Laight
2014-01-09  8:34       ` Fan Du
2014-01-09  9:07         ` David Laight
2014-01-07 18:07 ` David Miller
2014-01-09  8:24   ` Fan Du

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52CF2BA7.9080408@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=davem@davemloft.net \
    --cc=dev@lists.strongswan.org \
    --cc=fan.du@windriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).