[systemd-devel] [PATCH] missing: add BPF_XOR

Michal Sekletar msekleta at redhat.com
Thu Aug 21 04:51:50 PDT 2014


On Thu, Aug 21, 2014 at 12:38:08PM +0200, Michael Olbrich wrote:
> BPF_XOR was introduced in kernel 3.7
> ---
> 
> This fixes compiling systemd for me. I'm not sure about the implications of
> this. I'm not sure what happens if the code using it is executed on a linux
> kernel < 3.7

I don't think that merging this patch makes sense since we don't really support
combination of old kernel and new systemd. Both components are so centric these
days that they should be updated in lockstep. Hence allowing people to compile
against very old kernels shouldn't be possible really.

AFAIK filter using unsupported BPF instruction will be rejected by kernel's
static analyzer for BPF code.

Michal

> 
> Michael
> 
>  src/shared/missing.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/shared/missing.h b/src/shared/missing.h
> index 3ff1a21..1321db1 100644
> --- a/src/shared/missing.h
> +++ b/src/shared/missing.h
> @@ -589,3 +589,7 @@ static inline int setns(int fd, int nstype) {
>  #ifndef NET_NAME_RENAMED
>  #  define NET_NAME_RENAMED 4
>  #endif
> +
> +#ifndef BPF_XOR
> +#  define BPF_XOR 0xa0
> +#endif
> -- 
> 2.1.0.rc1
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list