Subject: Re: [PATCH iproute2] ip xfrm: support 64bit kernel and 32bit userspace

From: FengYu LeiDian <[email-masked]>
Date: Fri, 28 Nov 2014 16:07:40 +0800

于 2014年11月28日 15:35, Li RongQing 写道:
> On Fri, Nov 28, 2014 at 3:08 PM, FengYu LeiDian
> <[email-masked]>  wrote:
>> >于 2014年11月28日 14:58,[email-masked]  写道:
>>> >>From: Li RongQing<[email-masked]>
>>> >>
>>> >>The size of struct xfrm_userpolicy_info is 168 bytes for 64bit kernel, and
>>> >>164 bytes for 32bit userspace because of the different alignment. and lead
>>> >>to "ip xfrm" be unable to work.
>>> >>
>>> >>add a pad in struct xfrm_userpolicy_info, and enable it by set
>>> >>KERNEL_64_USERSPACE_32 to y
>> >
>> >
>> >It's not easy to fix it like this.
>> >
>> >Refer:
>> >http://marc.info/?l=linux-netdev&m=139280143513650&w=2
>> >http://thread.gmane.org/gmane.linux.network/157118/focus=157122
>> >
> is it be practical to find all structures which has the issue for
> 64bit kernel and 32 bit
> userspace, and conditionally add a pad for them

Apparently struct xfrm_userpolicy_info is not the only one,
you could try to set SA as well, it breaks also...
Fix those where it hurts, hehe :) Otherwise, the "compat layer"
fix style is good choice.