Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
int lxc_cmd_init(const char *name, const char *lxcpath, const char *suffix)
{
int fd, len, ret;
- char path[sizeof(((struct sockaddr_un *)0)->sun_path)] = {0};
+ char path[LXC_AUDS_ADDR_LEN] = {0};
char *offset = &path[1];
/* -2 here because this is an abstract unix socket so it needs a
const char *hashed_sock_name, const char *suffix)
{
int ret, client_fd;
- char path[sizeof(((struct sockaddr_un *)0)->sun_path)] = {0};
+ char path[LXC_AUDS_ADDR_LEN] = {0};
char *offset = &path[1];
/* -2 here because this is an abstract unix socket so it needs a
#include <string.h>
#include <sys/mount.h>
#include <sys/socket.h>
+#include <sys/un.h>
/* Define __S_ISTYPE if missing from the C library. */
#ifndef __S_ISTYPE
#define MACVLAN_MODE_PASSTHRU 8
#endif
+/* Length of abstract unix domain socket socket address. */
+#define LXC_AUDS_ADDR_LEN sizeof(((struct sockaddr_un *)0)->sun_path)
+
/* mount */
#ifndef MS_REC
#define MS_REC 16384