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
89092815
Unverified
Commit
89092815
authored
Aug 27, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: increase lxc-user-nic buffer
This will allow us log more detailed failures. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
8b8e00a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
conf.c
src/lxc/conf.c
+4
-7
No files found.
src/lxc/conf.c
View file @
89092815
...
@@ -3286,9 +3286,6 @@ bool lxc_delete_network(struct lxc_handler *handler)
...
@@ -3286,9 +3286,6 @@ bool lxc_delete_network(struct lxc_handler *handler)
}
}
#define LXC_USERNIC_PATH LIBEXECDIR "/lxc/lxc-user-nic"
#define LXC_USERNIC_PATH LIBEXECDIR "/lxc/lxc-user-nic"
/* lxc-user-nic returns "interface_name:interface_name\n" */
#define MAX_BUFFER_SIZE IFNAMSIZ * 2 + 2
static
int
unpriv_assign_nic
(
const
char
*
lxcpath
,
char
*
lxcname
,
static
int
unpriv_assign_nic
(
const
char
*
lxcpath
,
char
*
lxcname
,
struct
lxc_netdev
*
netdev
,
pid_t
pid
)
struct
lxc_netdev
*
netdev
,
pid_t
pid
)
{
{
...
@@ -3297,7 +3294,7 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname,
...
@@ -3297,7 +3294,7 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname,
int
bytes
,
pipefd
[
2
];
int
bytes
,
pipefd
[
2
];
char
*
token
,
*
saveptr
=
NULL
;
char
*
token
,
*
saveptr
=
NULL
;
char
netdev_link
[
IFNAMSIZ
+
1
];
char
netdev_link
[
IFNAMSIZ
+
1
];
char
buffer
[
MAX
_BUFFER_SIZE
]
=
{
0
};
char
buffer
[
MAX
PATHLEN
]
=
{
0
};
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
ERROR
(
"nic type %d not support for unprivileged use"
,
ERROR
(
"nic type %d not support for unprivileged use"
,
...
@@ -3363,7 +3360,7 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname,
...
@@ -3363,7 +3360,7 @@ static int unpriv_assign_nic(const char *lxcpath, char *lxcname,
/* close the write-end of the pipe */
/* close the write-end of the pipe */
close
(
pipefd
[
1
]);
close
(
pipefd
[
1
]);
bytes
=
read
(
pipefd
[
0
],
&
buffer
,
MAX
_BUFFER_SIZE
);
bytes
=
read
(
pipefd
[
0
],
&
buffer
,
MAX
PATHLEN
);
if
(
bytes
<
0
)
{
if
(
bytes
<
0
)
{
SYSERROR
(
"Failed to read from pipe file descriptor."
);
SYSERROR
(
"Failed to read from pipe file descriptor."
);
close
(
pipefd
[
0
]);
close
(
pipefd
[
0
]);
...
@@ -5148,7 +5145,7 @@ int lxc_unpriv_delete_nic(const char *lxcpath, char *lxcname,
...
@@ -5148,7 +5145,7 @@ int lxc_unpriv_delete_nic(const char *lxcpath, char *lxcname,
{
{
pid_t
child
;
pid_t
child
;
int
bytes
,
pipefd
[
2
];
int
bytes
,
pipefd
[
2
];
char
buffer
[
MAX
_BUFFER_SIZE
]
=
{
0
};
char
buffer
[
MAX
PATHLEN
]
=
{
0
};
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
ERROR
(
"nic type %d not support for unprivileged use"
,
ERROR
(
"nic type %d not support for unprivileged use"
,
...
@@ -5207,7 +5204,7 @@ int lxc_unpriv_delete_nic(const char *lxcpath, char *lxcname,
...
@@ -5207,7 +5204,7 @@ int lxc_unpriv_delete_nic(const char *lxcpath, char *lxcname,
/* close the write-end of the pipe */
/* close the write-end of the pipe */
close
(
pipefd
[
1
]);
close
(
pipefd
[
1
]);
bytes
=
read
(
pipefd
[
0
],
&
buffer
,
MAX
_BUFFER_SIZE
);
bytes
=
read
(
pipefd
[
0
],
&
buffer
,
MAX
PATHLEN
);
if
(
bytes
<
0
)
{
if
(
bytes
<
0
)
{
SYSERROR
(
"Failed to read from pipe file descriptor."
);
SYSERROR
(
"Failed to read from pipe file descriptor."
);
close
(
pipefd
[
0
]);
close
(
pipefd
[
0
]);
...
...
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