netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ss: fix compilation under glibc < 2.18
@ 2019-02-20 14:41 Thomas De Schampheleire
  2019-02-21  1:53 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas De Schampheleire @ 2019-02-20 14:41 UTC (permalink / raw)
  To: netdev; +Cc: Thomas De Schampheleire

From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

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>
---
 misc/ss.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/misc/ss.c b/misc/ss.c
index 9e821faf..766fdc5f 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -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)
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-21 22:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20 14:41 [PATCH iproute2] ss: fix compilation under glibc < 2.18 Thomas De Schampheleire
2019-02-21  1:53 ` Stephen Hemminger
2019-02-21  7:43   ` Thomas De Schampheleire
2019-02-21 22:49     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).