Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
970ef13d
Commit
970ef13d
authored
Jul 04, 2019
by
Wolfgang Bumiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_unix: add lxc_unix_connect_type
we want to use SOCK_SEQPACKET and in the future perhaps SOCK_DATAGRAM as well Signed-off-by:
Wolfgang Bumiller
<
w.bumiller@proxmox.com
>
parent
dc85e31e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
af_unix.c
src/lxc/af_unix.c
+7
-2
af_unix.h
src/lxc/af_unix.h
+1
-0
No files found.
src/lxc/af_unix.c
View file @
970ef13d
...
@@ -379,13 +379,13 @@ int lxc_unix_sockaddr(struct sockaddr_un *ret, const char *path)
...
@@ -379,13 +379,13 @@ int lxc_unix_sockaddr(struct sockaddr_un *ret, const char *path)
return
(
int
)(
offsetof
(
struct
sockaddr_un
,
sun_path
)
+
len
+
1
);
return
(
int
)(
offsetof
(
struct
sockaddr_un
,
sun_path
)
+
len
+
1
);
}
}
int
lxc_unix_connect
(
struct
sockaddr_un
*
addr
)
int
lxc_unix_connect
_type
(
struct
sockaddr_un
*
addr
,
int
type
)
{
{
__do_close_prot_errno
int
fd
=
-
EBADF
;
__do_close_prot_errno
int
fd
=
-
EBADF
;
int
ret
;
int
ret
;
ssize_t
len
;
ssize_t
len
;
fd
=
socket
(
AF_UNIX
,
SOCK_STREAM
|
SOCK_CLOEXEC
,
0
);
fd
=
socket
(
AF_UNIX
,
type
|
SOCK_CLOEXEC
,
0
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
SYSERROR
(
"Failed to open new AF_UNIX socket"
);
SYSERROR
(
"Failed to open new AF_UNIX socket"
);
return
-
1
;
return
-
1
;
...
@@ -406,6 +406,11 @@ int lxc_unix_connect(struct sockaddr_un *addr)
...
@@ -406,6 +406,11 @@ int lxc_unix_connect(struct sockaddr_un *addr)
return
move_fd
(
fd
);
return
move_fd
(
fd
);
}
}
int
lxc_unix_connect
(
struct
sockaddr_un
*
addr
,
int
type
)
{
return
lxc_unix_connect_type
(
addr
,
SOCK_STREAM
);
}
int
lxc_socket_set_timeout
(
int
fd
,
int
rcv_timeout
,
int
snd_timeout
)
int
lxc_socket_set_timeout
(
int
fd
,
int
rcv_timeout
,
int
snd_timeout
)
{
{
struct
timeval
out
=
{
0
};
struct
timeval
out
=
{
0
};
...
...
src/lxc/af_unix.h
View file @
970ef13d
...
@@ -46,6 +46,7 @@ extern int lxc_abstract_unix_send_credential(int fd, void *data, size_t size);
...
@@ -46,6 +46,7 @@ extern int lxc_abstract_unix_send_credential(int fd, void *data, size_t size);
extern
int
lxc_abstract_unix_rcv_credential
(
int
fd
,
void
*
data
,
size_t
size
);
extern
int
lxc_abstract_unix_rcv_credential
(
int
fd
,
void
*
data
,
size_t
size
);
extern
int
lxc_unix_sockaddr
(
struct
sockaddr_un
*
ret
,
const
char
*
path
);
extern
int
lxc_unix_sockaddr
(
struct
sockaddr_un
*
ret
,
const
char
*
path
);
extern
int
lxc_unix_connect
(
struct
sockaddr_un
*
addr
);
extern
int
lxc_unix_connect
(
struct
sockaddr_un
*
addr
);
extern
int
lxc_unix_connect_type
(
struct
sockaddr_un
*
addr
,
int
type
);
extern
int
lxc_socket_set_timeout
(
int
fd
,
int
rcv_timeout
,
int
snd_timeout
);
extern
int
lxc_socket_set_timeout
(
int
fd
,
int
rcv_timeout
,
int
snd_timeout
);
#endif
/* __LXC_AF_UNIX_H */
#endif
/* __LXC_AF_UNIX_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment