I am in the process of migrating an IPsec application from VxWorks to Linux. And I am pretty new to Linux. The component that uses IPsec is a 32-bit application. However, the entire product runs in a 64-bit environment.
We are using Ubuntu 16.04 (LTS) on a X86_64 machine. Linux kernel version is 4.9.
32-bit IPsec on 64-bit kernels has compatibility issues with respect to structure padding in xfrm.h. This was an easy problem to fix. However, after fixing this issue, I was not able to install SAs. The XFRM framework was returning -95 not supported
errors.
After debugging I found the check below in xfrm_user_rcv_msg()
was causing the issue. I commented the block just for testing. After rebuilding the kernel with this change the 32-bit IPsec app worked fine on the 64-bit kernel.
I wanted to understand the reason behind this check and if it really is necessary to remove it to run 32-bit IPsec applications on 64-bit kernels.
#ifdef CONFIG_COMPAT
if (in_compat_syscall())
return -EOPNOTSUPP;
#endif
Regards Jayalakshmi