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
b41431e8
Commit
b41431e8
authored
Sep 04, 2017
by
Stéphane Graber
Committed by
GitHub
Sep 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1782 from brauner/2017-09-04/fix_tty_sending
conf: don't send ttys when none are configured
parents
36259ede
7729f8e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
31 deletions
+15
-31
conf.c
src/lxc/conf.c
+3
-2
network.c
src/lxc/network.c
+8
-28
start.c
src/lxc/start.c
+4
-1
No files found.
src/lxc/conf.c
View file @
b41431e8
...
...
@@ -3072,6 +3072,9 @@ static int lxc_send_ttys_to_parent(struct lxc_handler *handler)
int
sock
=
handler
->
data_sock
[
0
];
int
ret
=
-
1
;
if
(
!
conf
->
tty
)
return
0
;
for
(
i
=
0
;
i
<
conf
->
tty
;
i
++
)
{
int
ttyfds
[
2
];
struct
lxc_pty_info
*
pty_info
=
&
tty_info
->
pty_info
[
i
];
...
...
@@ -3093,8 +3096,6 @@ static int lxc_send_ttys_to_parent(struct lxc_handler *handler)
else
TRACE
(
"Sent %d ttys to parent"
,
conf
->
tty
);
close
(
handler
->
data_sock
[
0
]);
close
(
handler
->
data_sock
[
1
]);
lxc_delete_tty
(
tty_info
);
return
ret
;
...
...
src/lxc/network.c
View file @
b41431e8
...
...
@@ -3003,14 +3003,9 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
continue
;
ret
=
send
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
0
);
if
(
ret
<
0
)
{
close
(
handler
->
data_sock
[
0
]);
close
(
handler
->
data_sock
[
1
]);
if
(
ret
<
0
)
return
-
1
;
}
else
{
TRACE
(
"Sent network device name
\"
%s
\"
to child"
,
netdev
->
name
);
}
TRACE
(
"Sent network device name
\"
%s
\"
to child"
,
netdev
->
name
);
}
return
0
;
...
...
@@ -3033,14 +3028,9 @@ int lxc_network_recv_veth_names_from_parent(struct lxc_handler *handler)
continue
;
ret
=
recv
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
0
);
if
(
ret
<
0
)
{
close
(
handler
->
data_sock
[
0
]);
close
(
handler
->
data_sock
[
1
]);
if
(
ret
<
0
)
return
-
1
;
}
else
{
TRACE
(
"Received network device name
\"
%s
\"
from parent"
,
netdev
->
name
);
}
TRACE
(
"Received network device name
\"
%s
\"
from parent"
,
netdev
->
name
);
}
return
0
;
...
...
@@ -3062,23 +3052,18 @@ int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler)
/* Send network device name in the child's namespace to parent. */
ret
=
send
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
0
);
if
(
ret
<
0
)
goto
on_error
;
return
-
1
;
/* Send network device ifindex in the child's namespace to
* parent.
*/
ret
=
send
(
data_sock
,
&
netdev
->
ifindex
,
sizeof
(
netdev
->
ifindex
),
0
);
if
(
ret
<
0
)
goto
on_error
;
return
-
1
;
}
TRACE
(
"Sent network device names and ifindeces to parent"
);
return
0
;
on_error:
close
(
handler
->
data_sock
[
0
]);
close
(
handler
->
data_sock
[
1
]);
return
-
1
;
}
int
lxc_network_recv_name_and_ifindex_from_child
(
struct
lxc_handler
*
handler
)
...
...
@@ -3099,20 +3084,15 @@ int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *handler)
*/
ret
=
recv
(
data_sock
,
netdev
->
name
,
IFNAMSIZ
,
0
);
if
(
ret
<
0
)
goto
on_error
;
return
-
1
;
/* Receive network device ifindex in the child's namespace to
* parent.
*/
ret
=
recv
(
data_sock
,
&
netdev
->
ifindex
,
sizeof
(
netdev
->
ifindex
),
0
);
if
(
ret
<
0
)
goto
on_error
;
return
-
1
;
}
return
0
;
on_error:
close
(
handler
->
data_sock
[
0
]);
close
(
handler
->
data_sock
[
1
]);
return
-
1
;
}
src/lxc/start.c
View file @
b41431e8
...
...
@@ -912,7 +912,10 @@ static int do_start(void *data)
}
/* Setup the container, ip, names, utsname, ... */
if
(
lxc_setup
(
handler
))
{
ret
=
lxc_setup
(
handler
);
close
(
handler
->
data_sock
[
0
]);
close
(
handler
->
data_sock
[
1
]);
if
(
ret
<
0
)
{
ERROR
(
"Failed to setup container
\"
%s
\"
."
,
handler
->
name
);
goto
out_warn_father
;
}
...
...
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