netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ip xfrm: support 64bit kernel and 32bit userspace
@ 2014-11-28  6:58 roy.qing.li
  2014-11-28  7:08 ` FengYu LeiDian
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: roy.qing.li @ 2014-11-28  6:58 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com> 

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

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 Makefile             | 4 ++++
 include/linux/xfrm.h | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index 9dbb29f..3cd0d67 100644
--- a/Makefile
+++ b/Makefile
@@ -18,6 +18,10 @@ ifneq ($(SHARED_LIBS),y)
 DEFINES+= -DNO_SHARED_LIBS
 endif
 
+ifeq ($(KERNEL_64_USERSPACE_32),y)
+DEFINES+= -DKNL_64_US_32
+endif
+
 DEFINES+=-DCONFDIR=\"$(CONFDIR)\"
 
 #options for decnet
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index fa2ecb2..009510c 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -407,6 +407,9 @@ struct xfrm_userpolicy_info {
 	/* Automatically expand selector to include matching ICMP payloads. */
 #define XFRM_POLICY_ICMP	2
 	__u8				share;
+#ifdef KNL_64_US_32
+	int				pad;
+#endif
 };
 
 struct xfrm_userpolicy_id {
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-30 17:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-28  6:58 [PATCH iproute2] ip xfrm: support 64bit kernel and 32bit userspace roy.qing.li
2014-11-28  7:08 ` FengYu LeiDian
2014-11-28  7:35   ` Li RongQing
2014-11-28  8:07     ` FengYu LeiDian
2014-11-28 10:47 ` David Laight
2014-11-30  1:33 ` Ben Hutchings
2014-11-30 17:42   ` Stephen Hemminger

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).