From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com ([209.85.215.68]:40105 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbeBZTsq (ORCPT ); Mon, 26 Feb 2018 14:48:46 -0500 Received: by mail-lf0-f68.google.com with SMTP id 37so23996251lfs.7 for ; Mon, 26 Feb 2018 11:48:45 -0800 (PST) Subject: Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4 From: Serhey Popovych To: netdev@vger.kernel.org Cc: thomas.de_schampheleire@nokia.com References: <1519674401-23631-1-git-send-email-serhe.popovych@gmail.com> Message-ID: <0d2dc64e-1a0f-ed3b-3196-9021b1d942eb@gmail.com> Date: Mon, 26 Feb 2018 21:48:39 +0200 MIME-Version: 1.0 In-Reply-To: <1519674401-23631-1-git-send-email-serhe.popovych@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="68k8qYrx045kPuaghoBpky11TDY6GR71u" Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --68k8qYrx045kPuaghoBpky11TDY6GR71u Content-Type: multipart/mixed; boundary="Lwcu17wqGTev4narc9zAKaJBNf6CfLK4A"; protected-headers="v1" From: Serhey Popovych To: netdev@vger.kernel.org Cc: thomas.de_schampheleire@nokia.com Message-ID: <0d2dc64e-1a0f-ed3b-3196-9021b1d942eb@gmail.com> Subject: Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4 References: <1519674401-23631-1-git-send-email-serhe.popovych@gmail.com> In-Reply-To: <1519674401-23631-1-git-send-email-serhe.popovych@gmail.com> --Lwcu17wqGTev4narc9zAKaJBNf6CfLK4A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Serhey Popovych wrote: > Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses ty= pes > __kernel_long_t and __kernel_ulong_t but does not provide internal > definitions for it. >=20 > This means that compilation using kernel headers that are older than 3.= 4 > (where these types were added) will fail. This situation may be uncommo= n for > native compilation, but not uncommon for cross compilation where the > toolchains may be a bit older. >=20 > Provide the necessary types internally if not provided by the kernel > headers to fix compilation in such cases. >=20 > Co-Developed-by: Serhii Popovych > Signed-off-by: Thomas De Schampheleire > Signed-off-by: Serhey Popovych > --- > include/linux/sysinfo.h | 14 ++++++++++++++ > misc/ss.c | 10 ++++++++++ > 2 files changed, 24 insertions(+) > create mode 100644 include/linux/sysinfo.h Oops, forgot to mention in subject: this is RFC one. >=20 > diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h > new file mode 100644 > index 0000000..766de8d > --- /dev/null > +++ b/include/linux/sysinfo.h > @@ -0,0 +1,14 @@ > +#ifndef _SYSINFO_COMPAT_H > +#define _SYSINFO_COMPAT_H > + > +/* In case the kernel header asm/posix_types.h is too old (< 3.4) to p= rovide > + * __kernel_long_t, provide it here > + */ > +#ifndef __kernel_long_t > +typedef long __kernel_long_t; > +typedef unsigned long __kernel_ulong_t; > +#endif > + > +#include_next > + > +#endif /* _SYSINFO_COMPAT_H */ > diff --git a/misc/ss.c b/misc/ss.c > index e047f9c..de5a673 100644 > --- a/misc/ss.c > +++ b/misc/ss.c > @@ -46,6 +46,16 @@ > #include > #include > =20 > +#ifndef AF_VSOCK > +#define AF_VSOCK 40 > +#if defined(AF_MAX) && AF_MAX < 41 > +#undef AF_MAX > +#endif > +#ifndef AF_MAX > +#define AF_MAX 41 > +#endif /* AF_MAX */ > +#endif /* AF_VSOCK */ > + > #define MAGIC_SEQ 123456 > #define BUF_CHUNK (1024 * 1024) > #define LEN_ALIGN(x) (((x) + 1) & ~1) >=20 --Lwcu17wqGTev4narc9zAKaJBNf6CfLK4A-- --68k8qYrx045kPuaghoBpky11TDY6GR71u Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJalGSbAAoJEBTawMmQ61bBjKoIALrukDSllZzq0urJdXdOZmr5 kkmTDSH8Ojc5fCKtIkgbaej2uzDuZdKSUowJJpeTeTx7U/iDIbtN7GrHQ4qfJJYD jVZlHX7o7WHODsyYplt5D8xLL3gvoJNLuEPVJCLDtquJe9dNIkP5hyB3LyEcTTwt EsJ5pGThCoFnjw0vlW3bSUQZ2T2KwB1oAyWViBxIssA0S0LAA/0K72KoHgt+hP78 z/2LMd1ovh3A7+BQ2age5pSJaoMMqErGceLmdqsU8WJf3rqHyYQcqxrjdwvFEv8B edALex2lzfi65TkZhY/FWuvjygbyhlNhfBMkVC30IZ8602X49NHdIePaTnbGqfk= =vk2o -----END PGP SIGNATURE----- --68k8qYrx045kPuaghoBpky11TDY6GR71u--