Skip to content
Commit e4dee444 authored by Roy Li's avatar Roy Li Committed by Joe MacDonald
Browse files

ebtables: enable KERNEL_64_USERSPACE_32 for powerpc



Enable KERNEL_64_USERSPACE_32 when powerpc is using 64bit kernel and 32bit
userspace.

Some structs, which is used to communicate between user space and kernel,
have the alignment issue on 64bit kernel with 32 bit userspace. To fix
this issue, ebtables redefines these struct, not use the kernel(sysroot)
include/uapi/linux/netfilter_bridge/ebtables.h, like ebt_entry_target:

The kernel's:
struct ebt_entry_target {
       union {
               char name[EBT_FUNCTION_MAXNAMELEN];
               struct xt_target *target;
       } u;
       /* size of data */
       unsigned int target_size;
       unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
};

The ebtables:
struct ebt_entry_target
{
        union {
                char name[EBT_FUNCTION_MAXNAMELEN];
                struct ebt_target *target;
        } u;
        /* size of data */
        unsigned int target_size;
|#ifdef KERNEL_64_USERSPACE_32
        unsigned int pad;
|#endif
        unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace))));
};

If the MLPREFIX of package matchs "lib.?32", the 32bit multilib package on
64bit kernel is being built, then enable KERNEL_64_USERSPACE_32.

Signed-off-by: default avatarRoy Li <rongqing.li@windriver.com>
Signed-off-by: default avatarMartin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: default avatarJoe MacDonald <joe_macdonald@mentor.com>
parent 038a0031
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment