Re: [PATCH iproute2 2/3] ss: Fix build with old libc headers without AF_VSOCK
From: Serhey Popovych <hidden>
Date: 2018-03-02 07:57:56
Attachments
- signature.asc [application/pgp-signature] 490 bytes
From: Serhey Popovych <hidden>
Date: 2018-03-02 07:57:56
Stephen Hemminger wrote:
On Tue, 27 Feb 2018 14:06:51 +0200 Serhey Popovych [off-list ref] wrote:quoted
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 <bits/socket.h> + +#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 */It makes more sense to change ss.c to ifdef out the code related to AF_VSOCK if it is not defined. Rather than asking for unknown address family.
Yes, I did this as v0 before sending series. But now I'm thinking that single place for all compat stuff would ease tracking of changes.