aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_user.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-01-20 12:49:51 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-20 12:49:51 -0500
commit66f9a2590aa87dc77cddaeaf46177de76edd2339 (patch)
treed186efb35e147878219dfecef1f2341f7192c7e8 /net/xfrm/xfrm_user.c
parentf4895b8bc83a22a36446c4aee277e1750fcc6a18 (diff)
Revert "xfrm: For 32/64 compatability wrt. xfrm_usersa_info"
This reverts commit fc8c7dc1b29560c016a67a34ccff32a712b5aa86. As indicated by Jiri Klimes, this won't work. These numbers are not only used the size validation, they are also used to locate attributes sitting after the message. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r--net/xfrm/xfrm_user.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 7877e7975dae..b95a2d64eb59 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1914,17 +1914,10 @@ static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
1914} 1914}
1915#endif 1915#endif
1916 1916
1917/* For the xfrm_usersa_info cases we have to work around some 32-bit vs.
1918 * 64-bit compatability issues. On 32-bit the structure is 220 bytes, but
1919 * for 64-bit it gets padded out to 224 bytes. Those bytes are just
1920 * padding and don't have any content we care about. Therefore as long
1921 * as we have enough bytes for the content we can make both cases work.
1922 */
1923
1924#define XMSGSIZE(type) sizeof(struct type) 1917#define XMSGSIZE(type) sizeof(struct type)
1925 1918
1926static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { 1919static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = {
1927 [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = 220, /* see above */ 1920 [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info),
1928 [XFRM_MSG_DELSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), 1921 [XFRM_MSG_DELSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id),
1929 [XFRM_MSG_GETSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id), 1922 [XFRM_MSG_GETSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_id),
1930 [XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), 1923 [XFRM_MSG_NEWPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info),
@@ -1934,7 +1927,7 @@ static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = {
1934 [XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire), 1927 [XFRM_MSG_ACQUIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_acquire),
1935 [XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire), 1928 [XFRM_MSG_EXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_expire),
1936 [XFRM_MSG_UPDPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info), 1929 [XFRM_MSG_UPDPOLICY - XFRM_MSG_BASE] = XMSGSIZE(xfrm_userpolicy_info),
1937 [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = 220, /* see above */ 1930 [XFRM_MSG_UPDSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_info),
1938 [XFRM_MSG_POLEXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire), 1931 [XFRM_MSG_POLEXPIRE - XFRM_MSG_BASE] = XMSGSIZE(xfrm_user_polexpire),
1939 [XFRM_MSG_FLUSHSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush), 1932 [XFRM_MSG_FLUSHSA - XFRM_MSG_BASE] = XMSGSIZE(xfrm_usersa_flush),
1940 [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0, 1933 [XFRM_MSG_FLUSHPOLICY - XFRM_MSG_BASE] = 0,