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
d8f8e352
Commit
d8f8e352
authored
Jan 05, 2012
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix network cleanup on error
Network cleanup does not cleanup correctly the virtual interfaces in case of an error. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
f0e64b8b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
conf.c
src/lxc/conf.c
+11
-5
start.c
src/lxc/start.c
+0
-1
No files found.
src/lxc/conf.c
View file @
d8f8e352
...
@@ -1702,13 +1702,19 @@ void lxc_delete_network(struct lxc_list *network)
...
@@ -1702,13 +1702,19 @@ void lxc_delete_network(struct lxc_list *network)
if
(
netdev
->
ifindex
==
0
)
if
(
netdev
->
ifindex
==
0
)
continue
;
continue
;
/* Recent kernels already delete the virtual devices */
if
(
netdev
->
type
==
LXC_NET_PHYS
)
{
if
(
netdev
->
type
!=
LXC_NET_PHYS
)
if
(
lxc_netdev_rename_by_index
(
netdev
->
ifindex
,
netdev
->
link
))
WARN
(
"failed to rename to the initial name the "
\
"netdev '%s'"
,
netdev
->
link
);
continue
;
continue
;
}
if
(
lxc_netdev_rename_by_index
(
netdev
->
ifindex
,
netdev
->
link
))
/* Recent kernel remove the virtual interfaces when the network
WARN
(
"failed to rename to the initial name the netdev '%s'"
,
* namespace is destroyed but in case we did not moved the
netdev
->
link
);
* interface to the network namespace, we have to destroy it
*/
if
(
lxc_netdev_delete_by_index
(
netdev
->
ifindex
))
WARN
(
"failed to remove interface '%s'"
,
netdev
->
name
);
}
}
}
}
...
...
src/lxc/start.c
View file @
d8f8e352
...
@@ -490,7 +490,6 @@ int lxc_spawn(struct lxc_handler *handler)
...
@@ -490,7 +490,6 @@ int lxc_spawn(struct lxc_handler *handler)
}
}
}
}
/* Create a process in a new set of namespaces */
/* Create a process in a new set of namespaces */
handler
->
pid
=
lxc_clone
(
do_start
,
handler
,
clone_flags
);
handler
->
pid
=
lxc_clone
(
do_start
,
handler
,
clone_flags
);
if
(
handler
->
pid
<
0
)
{
if
(
handler
->
pid
<
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