]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ss: fix compilation under glibc < 2.18
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Wed, 20 Feb 2019 14:41:51 +0000 (15:41 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 21 Feb 2019 22:40:52 +0000 (14:40 -0800)
Commit c759116a0b2b6da8df9687b0a40ac69050132c77 introduced support for
AF_VSOCK. This define is only provided since glibc version 2.18, so
compilation fails when using older toolchains.

Provide the necessary definitions if needed.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
misc/ss.c

index 9e821faf0d3178beeb773250a14e1b790ca18b6e..766fdc5f5bb6b9ce6bc42e8beb88086e2b707645 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
 #include <linux/tipc_netlink.h>
 #include <linux/tipc_sockets_diag.h>
 
+/* AF_VSOCK/PF_VSOCK is only provided since glibc 2.18 */
+#ifndef PF_VSOCK
+#define PF_VSOCK 40
+#endif
+#ifndef AF_VSOCK
+#define AF_VSOCK PF_VSOCK
+#endif
+
 #define MAGIC_SEQ 123456
 #define BUF_CHUNK (1024 * 1024)
 #define LEN_ALIGN(x) (((x) + 1) & ~1)