Subject: Re: [PATCH iproute2 2/3] ss: Fix build with old libc headers without AF_VSOCK

From: Stephen Hemminger <[email-masked]>
Date: Wed, 28 Feb 2018 16:13:28 -0800

On Tue, 27 Feb 2018 14:06:51 +0200
Serhey Popovych <[email-masked]> wrote:

> 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.