ss: fix compilation under glibc < 2.18

Commit c759116a0b 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>
This commit is contained in:
Thomas De Schampheleire 2019-02-20 15:41:51 +01:00 committed by Stephen Hemminger
parent 6f618a6a82
commit 9700927a00
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,14 @@
#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)