From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com ([209.85.215.68]:34887 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752331AbeB0MHM (ORCPT ); Tue, 27 Feb 2018 07:07:12 -0500 Received: by mail-lf0-f68.google.com with SMTP id 70so27159444lfw.2 for ; Tue, 27 Feb 2018 04:07:11 -0800 (PST) From: Serhey Popovych To: netdev@vger.kernel.org Cc: thomas.de_schampheleire@nokia.com Subject: [PATCH iproute2 2/3] ss: Fix build with old libc headers without AF_VSOCK Date: Tue, 27 Feb 2018 14:06:51 +0200 Message-Id: <1519733212-30703-3-git-send-email-serhe.popovych@gmail.com> In-Reply-To: <1519733212-30703-1-git-send-email-serhe.popovych@gmail.com> References: <1519733212-30703-1-git-send-email-serhe.popovych@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: At the moment Linux Kernel 3.2 is the last supported LTS. It comes without AF_VSOCK support (added only in 3.10), therefore old libcs, such as glibc before 2.18 does not provide, cause ss(8) tool build failures like following: ss.c:294:15: error: 'AF_VSOCK' undeclared here (not in a function) ss.c:323:2: error: array index in initializer not of integer type ss.c:323:2: error: (near initialization for 'default_afs') make[1]: *** [ss.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [all] Error 2 Provide AF_VSOCK and PF_VSOCK defines for compatibility; adjust AF_MAX and PF_MAX to reflect change. Tested in Debian 7 (Wheezy) environment with glibc-2.13 and Linux Kernel 3.2. Still supported config until 31 May 2018 according to Debian LTS support page. Signed-off-by: Serhey Popovych --- include/compat/libc/bits/socket.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/compat/libc/bits/socket.h diff --git a/include/compat/libc/bits/socket.h b/include/compat/libc/bits/socket.h new file mode 100644 index 0000000..25ef0d5 --- /dev/null +++ b/include/compat/libc/bits/socket.h @@ -0,0 +1,15 @@ +#ifndef _IP_COMPAT_BITS_SOCKET_H +#define _IP_COMPAT_BITS_SOCKET_H + +#include_next + +#ifndef AF_VSOCK +#define PF_VSOCK 40 +#define AF_VSOCK PF_VSOCK +#undef PF_MAX +#undef AF_MAX +#define PF_MAX 41 +#define AF_MAX PF_MAX +#endif /* AF_VSOCK */ + +#endif /* _IP_COMPAT_BITS_SOCKET_H */ -- 1.7.10.4